diff options
| author | Misko Hevery | 2012-02-22 12:59:23 -0800 |
|---|---|---|
| committer | Misko Hevery | 2012-02-22 12:59:23 -0800 |
| commit | c27a56f4da9bf89e471ac6597c135e2f19814f17 (patch) | |
| tree | 195faba53e34785e05d9685765880956ed9464f4 /docs | |
| parent | fbcb7fdd141c277d326dc3ed34545210c4d5628f (diff) | |
| download | angular.js-c27a56f4da9bf89e471ac6597c135e2f19814f17.tar.bz2 | |
docs(scope): show which directives create scopes
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/spec/ngdocSpec.js | 20 | ||||
| -rw-r--r-- | docs/src/ngdoc.js | 17 |
2 files changed, 36 insertions, 1 deletions
diff --git a/docs/spec/ngdocSpec.js b/docs/spec/ngdocSpec.js index 8082e4b1..4b809479 100644 --- a/docs/spec/ngdocSpec.js +++ b/docs/spec/ngdocSpec.js @@ -349,6 +349,26 @@ describe('ngdoc', function() { }); }); + describe('@scope', function() { + it('should state the new scope will be created', function() { + var doc = new Doc('@name a\n@scope'); + doc.ngdoc = 'directive'; + doc.parse(); + expect(doc.scope).toEqual(''); + expect(doc.html()).toContain('This directive creates new scope.'); + }); + }); + + describe('@priority', function() { + it('should state the priority', function() { + var doc = new Doc('@name a\n@priority 123'); + doc.ngdoc = 'directive'; + doc.parse(); + expect(doc.priority).toEqual('123'); + expect(doc.html()).toContain('This directive executes at priority level 123.'); + }); + }); + describe('@property', function() { it('should parse @property tags into array', function() { var doc = new Doc("@name a\n@property {type} name1 desc\n@property {type} name2 desc"); diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 87f9ab62..fc606d54 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -374,6 +374,7 @@ Doc.prototype = { dom.text('>\n ...\n'); dom.text('</' + self.element + '>'); }); + self.html_usage_directiveInfo(dom); self.html_usage_parameters(dom); }); }, @@ -461,11 +462,25 @@ Doc.prototype = { }); }); + self.html_usage_directiveInfo(dom); self.html_usage_parameters(dom); - self.html_usage_returns(dom); }); }, + html_usage_directiveInfo: function(dom) { + var self = this; + var list = []; + + + if (self.scope !== undefined) { + list.push('This directive creates new scope.'); + } + if (self.priority !== undefined) { + list.push('This directive executes at priority level ' + self.priority + '.'); + } + dom.ul(list); + }, + html_usage_overview: function(dom){ dom.html(this.description); }, |
