Improve this Doc  View Source

$animate

  1. - $animateProvider
  2. - service in module ng

The $animate service exposes a series of DOM utility methods that provide support for animation hooks. The default behavior is the application of DOM operations, however, when an animation is detected (and animations are enabled), $animate will do the heavy lifting to ensure that animation runs with the triggered DOM operation.

By default $animate doesn't trigger any animations. This is because the ngAnimate module isn't included and only when it is active then the animation hooks that $animate triggers will be functional. Once active then all structural ng- directives will trigger animations as they perform their DOM-related operations (enter, leave and move). Other directives such as ngClass, ngShow, ngHide and ngMessages also provide support for animations.

It is recommended that the$animate service is always used when executing DOM-related procedures within directives.

To learn more about enabling animation support, click here to visit the ngAnimate module page.

Methods