View source Improve this doc

$animateProvider

service in module ng

Description

Default implementation of $animate that doesn't perform any animations, instead just synchronously performs DOM updates and calls done() callbacks.

In order to enable animations the ngAnimate module has to be loaded.

To see the functional implementation check out src/ngAnimate/animate.js

Methods

  • register(name, factory)

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.

  • eventFn: function(Element, doneFunction) The element to animate, the doneFunction 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.
  1. return {
  2. eventFn : function(element, done) {
  3. //code to run the animation
  4. //once complete, then run done()
  5. return function cancellationFunction() {
  6. //code to cancel the animation
  7. }
  8. }
  9. }
Parameters

ParamTypeDetailsnamestring

The name of the animation.

factoryfunction

The factory function that will be executed to return the animation object.