$animate.on()

on(event, container, callback);

Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...) has fired on the given element or among any of its children. Once the listener is fired, the provided callback is fired with the following params:

$animate.on('enter', container,
   function callback(element, phase) {
     // cool we detected an enter animation within the container
   }
);

Parameters

Param Type Details
event string

the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)

container DOMElement

the container element that will capture each of the animation events that are fired on itself as well as among its children

callback Function

the callback function that will be fired when the listener is triggered

The arguments present in the callback function are:

  • element - The captured DOM element that the animation was fired on.
  • phase - The phase of the animation. The two possible phases are start (when the animation starts) and close (when it ends).
doc_AngularJS
2016-03-29 16:10:06
Comments
Leave a Comment

Please login to continue.