UNPKG

knowhow-server

Version:

A personal workflow engine that can manage and use any network connected host

54 lines (53 loc) 4.09 kB
<a href="http://github.com/angular/angular.js/tree/v1.2.9/src/ng/animate.js#L5" class="view-source btn btn-action"><i class="icon-zoom-in"> </i> View source</a><a href="http://github.com/angular/angular.js/edit/master/src/ng/animate.js" class="improve-docs btn btn-primary"><i class="icon-edit"> </i> Improve this doc</a><h1><code ng:non-bindable="">$animateProvider</code> <div><span class="hint">service in module <code ng:non-bindable="">ng</code> </span> </div> </h1> <div><h2 id="description">Description</h2> <div class="description"><div class="ng-animateprovider-page"><p>Default implementation of $animate that doesn&#39;t perform any animations, instead just synchronously performs DOM updates and calls done() callbacks.</p> <p>In order to enable animations the ngAnimate module has to be loaded.</p> <p>To see the functional implementation check out src/ngAnimate/animate.js</p> </div></div> <div class="member method"><h2 id="methods">Methods</h2> <ul class="methods"><li><h3 id="methods_classnamefilter">classNameFilter(expression)</h3> <div class="classnamefilter"><div class="ng-animateprovider-classnamefilter-page"><p>Sets and/or returns the CSS class regular expression that is checked when performing an animation. Upon bootstrap the classNameFilter value is not set at all and will therefore enable $animate to attempt to perform an animation on any element. When setting the classNameFilter value, animations will only be performed on elements that successfully match the filter expression. This in turn can boost performance for low-powered devices as well as applications containing a lot of structural operations.</p> </div><h5 id="methods_classnamefilter_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>expression <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-regexp">RegExp</a></td><td><div class="ng-animateprovider-classnamefilter-page"><p>The className expression which will be checked against all animations</p> </div></td></tr></tbody></table><h5 id="methods_classnamefilter_returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-regexp">RegExp</a></td><td><div class="ng-animateprovider-classnamefilter-page"><p>The current CSS className expression value. If null then there is no expression value</p> </div></td></tr></table></div> </li> <li><h3 id="methods_register">register(name, factory)</h3> <div class="register"><div class="ng-animateprovider-register-page"><p>Registers a new injectable animation factory function. The factory function produces the animation object which contains callback functions for each event that is expected to be animated.</p> <ul> <li><code>eventFn</code>: <code>function(Element, doneFunction)</code> The element to animate, the <code>doneFunction</code> must be called once the element animation is complete. If a function is returned then the animation service will use this function to cancel the animation whenever a cancel event is triggered.</li> </ul> <pre class="prettyprint linenums"> return { eventFn : function(element, done) { //code to run the animation //once complete, then run done() return function cancellationFunction() { //code to cancel the animation } } } </pre> </div><h5 id="methods_register_parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>name</td><td><a href="" class="label type-hint type-hint-string">string</a></td><td><div class="ng-animateprovider-register-page"><p>The name of the animation.</p> </div></td></tr><tr><td>factory</td><td><a href="" class="label type-hint type-hint-function">function</a></td><td><div class="ng-animateprovider-register-page"><p>The factory function that will be executed to return the animation object.</p> </div></td></tr></tbody></table></div> </li> </ul> </div> </div>