Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

chore(docs): use correct script-URL for plnkr on snapshot #15438

Closed

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Nov 26, 2016

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bug fix (for docs app).

What is the current behavior? (You can also link to an open issue here)
The URLs used for scripts when opening an example from the snapshot version in plnkr is incorrect and the code does not work.
See #15437.

What is the new behavior (if this is a feature change)?
The correct script URLs are used and the examples work.

Does this PR introduce a breaking change?
No.

Please check if the PR fulfills these requirements

Other information:
Fixes #15437

@@ -13,7 +13,7 @@ var cdnUrl = googleCdnUrl + versionInfo.cdnVersion;
// The currentVersion may not be available on the cdn (e.g. if built locally, or hasn't been pushed
// yet). This will lead to a 404, but this is preferable to loading a version with which the example
// might not work (possibly in subtle ways).
var examplesCdnUrl = versionInfo.isSnapshot ?
var examplesCdnUrl = versionInfo.currentVersion.isSnapshot ?
(angularCodeUrl + 'snapshot') :
(googleCdnUrl + (versionInfo.version || versionInfo.currentVersion));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this also wrong then? (there is no versionInfo.version)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I couldn't find where version may have been defined, so I left it untouched in order to avoid breaking anything. But it is clear now that (a) versionInfo can never have a version property and (b) it is referring to the version property of the SemVer object (returned from semver.parse(...)) of versionInfo.currentVersion.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, it doesn't matter in practice, because Semver.prototype.toString() just returns the version property, but I will change it to versionInfo.currentVersion.version just in case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are right @Narretz

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gkalpak That's right. Maybe we can simplify this later. For now, let's get the fix merged, so the examples start working again.

@Narretz
Copy link
Contributor

Narretz commented Nov 27, 2016

LGTM. We can handle the comment later (if it needs to be handled)

@gkalpak gkalpak closed this in c625b0d Nov 28, 2016
gkalpak added a commit that referenced this pull request Nov 28, 2016
@gkalpak gkalpak deleted the chore-docs-correct-snapshot-url branch November 30, 2016 11:54
ellimist pushed a commit to ellimist/angular.js that referenced this pull request Mar 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All the sample plunker from API Reference page examples aren't working
4 participants