diff options
| author | Misko Hevery | 2011-08-25 22:23:10 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-08-31 14:30:21 -0700 | 
| commit | 08d09ecbaa07564bf3cf6a62e0be4c41b355d23b (patch) | |
| tree | 749586800d86a58441ac621e69649c574aa0dfc7 /docs/src/ngdoc.js | |
| parent | 456c7f62c5b437aef7d23af5af9c05c30531a594 (diff) | |
| download | angular.js-08d09ecbaa07564bf3cf6a62e0be4c41b355d23b.tar.bz2 | |
feat(docs): add support for events
Diffstat (limited to 'docs/src/ngdoc.js')
| -rw-r--r-- | docs/src/ngdoc.js | 19 | 
1 files changed, 18 insertions, 1 deletions
| diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 8fcf3cd5..a9abe7a6 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -29,6 +29,7 @@ function Doc(text, file, line) {    this.param = this.param || [];    this.properties = this.properties || [];    this.methods = this.methods || []; +  this.events = this.events || [];    this.links = this.links || [];  }  Doc.METADATA_IGNORE = (function(){ @@ -217,6 +218,10 @@ Doc.prototype = {                description: self.markdown(text.replace(match[0], match[4]))              };            self.properties.push(property); +        } else if(atName == 'eventType') { +          var match = text.match(/^([^\s]*)\s+on\s+([\S\s]*)/); +          self.type = match[1]; +          self.source = match[2];          } else {            self[atName] = text;          } @@ -525,6 +530,18 @@ Doc.prototype = {         dom.h('Example', property.example, dom.html);        });      }); +    dom.h('Events', this.events, function(event){ +      var signature = (event.param || []).map(property('name')); +      dom.h(event.type + ' ' + +          event.shortName + '(' + signature.join(', ') + ') on ' + +          event.source, event, function(){ +        dom.html(event.description); +        event.html_usage_parameters(dom); +        self.html_usage_this(dom); + +        dom.h('Example', event.example, dom.html); +      }); +    });    },    parameters: function(dom, separator, skipFirst, prefix) { @@ -717,7 +734,7 @@ function merge(docs){      });      // merge into parents -    if (findParent(doc, 'method') || findParent(doc, 'property')) { +    if (findParent(doc, 'method') || findParent(doc, 'property') || findParent(doc, 'event')) {        docs.splice(i, 1);      } else {        i++; | 
