diff options
| author | Misko Hevery | 2013-03-20 16:24:23 -0700 | 
|---|---|---|
| committer | Misko Hevery | 2013-04-02 14:05:06 -0700 | 
| commit | 0b6f1ce5f89f47f9302ff1e8cd8f4b92f837c413 (patch) | |
| tree | 8cbc0c86024dd4f97d0aa54e0c9b7df9b0d56b86 /docs/src/ngdoc.js | |
| parent | 4bfb66ce0be46d3a0e9da2f80f3e1d0c2b559828 (diff) | |
| download | angular.js-0b6f1ce5f89f47f9302ff1e8cd8f4b92f837c413.tar.bz2 | |
feat(ngAnimate): add support for animation
Diffstat (limited to 'docs/src/ngdoc.js')
| -rw-r--r-- | docs/src/ngdoc.js | 54 | 
1 files changed, 54 insertions, 0 deletions
| diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index f8f6cdf5..2a96abd9 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -328,6 +328,18 @@ Doc.prototype = {        });        dom.html(param.description);      }); +    if(this.animations) { +      dom.h('Animations', this.animations, function(animations){ +        dom.html('<ul>'); +        var animations = animations.split("\n"); +        animations.forEach(function(ani) { +          dom.html('<li>'); +          dom.text(ani); +          dom.html('</li>'); +        }); +        dom.html('</ul>'); +      }); +    }    },    html_usage_returns: function(dom) { @@ -433,6 +445,48 @@ Doc.prototype = {              dom.text('</' + element + '>');            });          } +        if(self.animations) { +          var animations = [], matches = self.animations.split("\n"); +          matches.forEach(function(ani) { +            var name = ani.match(/^\s*(.+?)\s*-/)[1]; +            animations.push(name); +          }); + +          dom.html('with <span id="animations">animations</span>'); +          var comment; +          if(animations.length == 1) { +            comment = 'The ' + animations[0] + ' animation is supported'; +          } +          else { +            var rhs = animations[animations.length-1]; +            var lhs = ''; +            for(var i=0;i<animations.length-1;i++) { +              if(i>0) { +                lhs += ', '; +              } +              lhs += animations[i]; +            } +            comment = 'The ' + lhs + ' and ' + rhs + ' animations are supported'; +          } +          var element = self.element || 'ANY'; +          dom.code(function() { +            dom.text('//' + comment + "\n"); +            dom.text('<' + element + ' '); +            dom.text(dashCase(self.shortName)); +            renderParams('\n     ', '="', '"', true); +            dom.text(' ng-animate="{'); +            animations.forEach(function(ani, index) { +              if (index) { +                dom.text(', '); +              } +              dom.text(ani + ': \'' + ani + '-animation\''); +            }); +            dom.text('}">\n   ...\n'); +            dom.text('</' + element + '>'); +          }); + +          dom.html('<a href="api/ng.$animator#Methods">Click here</a> to learn more about the steps involved in the animation.'); +        }        }        self.html_usage_directiveInfo(dom);        self.html_usage_parameters(dom); | 
