diff options
| author | Igor Minar | 2012-04-06 16:35:17 -0700 |
|---|---|---|
| committer | Igor Minar | 2012-04-09 09:52:27 -0700 |
| commit | 82d90a409692e97a79c3bf4708ee80796c7de2d6 (patch) | |
| tree | b682f2d3042381e2456383f9c9333d30105febf8 /docs/src/ngdoc.js | |
| parent | 7468bcb80b997e323bb0808d19ee215cc5f7ae84 (diff) | |
| download | angular.js-82d90a409692e97a79c3bf4708ee80796c7de2d6.tar.bz2 | |
fix(docs): change all directive references to use the normalized names
Diffstat (limited to 'docs/src/ngdoc.js')
| -rw-r--r-- | docs/src/ngdoc.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 4dd3dcc0..70411052 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -372,10 +372,10 @@ Doc.prototype = { dom.text(')'); dom.code(function() { dom.text('<'); - dom.text(self.shortName); + dom.text(dashCase(self.shortName)); renderParams('\n ', '="', '"'); dom.text('>\n</'); - dom.text(self.shortName); + dom.text(dashCase(self.shortName)); dom.text('>'); }); } @@ -384,7 +384,7 @@ Doc.prototype = { dom.text('as attribute'); dom.code(function() { dom.text('<' + element + ' '); - dom.text(self.shortName); + dom.text(dashCase(self.shortName)); renderParams('\n ', '="', '"', true); dom.text('>\n ...\n'); dom.text('</' + element + '>'); @@ -395,7 +395,7 @@ Doc.prototype = { var element = self.element || 'ANY'; dom.code(function() { dom.text('<' + element + ' class="'); - dom.text(self.shortName); + dom.text(dashCase(self.shortName)); renderParams(' ', ': ', ';', true); dom.text('">\n ...\n'); dom.text('</' + element + '>'); @@ -467,7 +467,7 @@ Doc.prototype = { (self.param||[]).forEach(function(param){ dom.text('\n '); dom.text(param.optional ? ' [' : ' '); - dom.text(param.name); + dom.text(dashCase(param.name)); dom.text(BOOLEAN_ATTR[param.name] ? '' : '="{' + param.type + '}"'); dom.text(param.optional ? ']' : ''); }); @@ -822,3 +822,11 @@ function property(name) { return value[name]; }; } + + +var DASH_CASE_REGEXP = /[A-Z]/g; +function dashCase(name){ + return name.replace(DASH_CASE_REGEXP, function(letter, pos) { + return (pos ? '-' : '') + letter.toLowerCase(); + }); +} |
