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

Fix for issue 3616 "View source" link on docs is broken #3675

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/spec/sourceLinkSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@ describe('Docs Links', function() {
expect(doc.html()).
toContain('<a href="http://github.com/angular/angular.js/edit/master/test.js" class="improve-docs btn btn-primary"><i class="icon-edit"> </i> Improve this doc</a>');
});

it("should have a defined gruntUtil.getVersion().cdn property", function () {
expect(gruntUtil.getVersion().cdn).toBeDefined();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

this test doesn't belong into this file. I would just remove it from here as we currently don't have a good way to test grunt/utils.js


it('should have an "view source" button', function() {
expect(doc.html()).
toContain('<a href="http://github.com/angular/angular.js/tree/v' + gruntUtil.getVersion().number + '/test.js#L42" class="view-source btn btn-action"><i class="icon-zoom-in"> </i> View source</a>');
toContain('<a href="http://github.com/angular/angular.js/tree/v' + gruntUtil.getVersion().cdn + '/test.js#L42" class="view-source btn btn-action"><i class="icon-zoom-in"> </i> View source</a>');
});

});
Expand Down
2 changes: 1 addition & 1 deletion docs/src/ngdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ Doc.prototype = {
if (this.section === 'api') {
dom.tag('a', {
href: 'http://github.com/angular/angular.js/tree/v' +
gruntUtil.getVersion().number + '/' + self.file + '#L' + self.line,
gruntUtil.getVersion().cdn + '/' + self.file + '#L' + self.line,
class: 'view-source btn btn-action' }, function(dom) {
dom.tag('i', {class:'icon-zoom-in'}, ' ');
dom.text(' View source');
Expand Down