forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathng.$animateProvider.html
42 lines (42 loc) · 2.53 KB
/
ng.$animateProvider.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<a href="http://github.com/angular/angular.js/tree/v1.2.3/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'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_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>