animation(name, animationFactory);
NOTE: animations take effect only if the ngAnimate module is loaded.
Defines an animation hook that can be later used with $animate service and directives that use this service.
1 2 3 4 5 6 7 8 9 10 11 | module.animation( '.animation-name' , function ($inject1, $inject2) { return { eventName : function (element, done) { //code to run the animation //once complete, then run done() return function cancellationFunction(element) { //code to cancel the animation } } } }) |
See $animateProvider.register() and ngAnimate module for more information.
Parameters
Param | Type | Details |
---|---|---|
name | string | animation name |
animationFactory | Function | Factory function for creating new instance of an animation. |
Please login to continue.