O'Reilly logo

Learning AngularJS Animations by Richard Keller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Animating the enter and leave events

The methods used to trigger the enter and leave animation events from the $animate service are $animate.enter and $animate.leave. They are the same animation events triggered by the ngIf, ngInclude, ngView, ngSwitch, ngRepeat, and ngMessage directives when an element is entered or removed from DOM.

The $animate.enter method adds the element sibling to the afterElement node or appends to the parentElement parameter and then runs the enter animation. After the animation is finished, the returned promise is resolved.

The method signature is as follows:

$animate.enter(element, parentElement, afterElement) 

The enter method follows these steps:

  1. $animate.enter(element, parentElement, afterElement) is called by the directive. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required