27.03.2017 Views

ng-book

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

A<strong>ng</strong>ular Animation 420<br />

1. Runs any JavaScript-defined animations on the element<br />

2. The [className]-remove class is added to the element<br />

3. $animate scans the CSS styles for transition/animation duration and delay properties<br />

4. The [className]-remove-active class is added to the element’s classList (triggeri<strong>ng</strong> the CSS<br />

animation)<br />

5. $animate waits for the defined duration to complete<br />

6. The animation ends, and $animate removes the three classes [className], [className]-add<br />

and [className]-add-active<br />

7. The done() callback function is fired (if defined)<br />

enter()<br />

The enter() method appends the element to its parent element in the DOM and then runs the enter<br />

animation. When the animation has started, the $animation service adds the classes <strong>ng</strong>-enter and<br />

<strong>ng</strong>-enter-active, givi<strong>ng</strong> the directive a chance to set up the animation.<br />

The enter() method can take up to four parameters:<br />

• element (jQuery/jqLite element)<br />

The element we’re animati<strong>ng</strong>.<br />

• parent (jQuery/jqLite element)<br />

The parent element of the element that is the focus of our enter animation.<br />

• after (jQuery/jqLite element)<br />

This is the sibli<strong>ng</strong> element of the element that will be the focus of the enter animation.<br />

• done (function)<br />

The callback function called when the animation is complete (if defined).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!