# `$animator` (service in module `ng` )

Improve this doc

## Description

The $animator service provides the DOM manipulation API which is decorated with animations.

## Usage

    $animator(scope, attr);

### Parameters

- `scope – {Scope} –`

  the scope for the ng-animate.

- `attr – {Attributes} –`

  the attributes object which contains the ngAnimate key / value pair. (The attributes are passed into the linking function of the directive using the `$animator`.)

### Returns

`{object}` –

the animator object which contains the enter, leave, move, show, hide and animate methods.

## Methods

- ### enter(element, parent, after)

  Injects the element object into the DOM (inside of the parent element) and then runs the enter animation.

  #### Parameters

  - `element – {jQuery/jqLite element} –`

    the element that will be the focus of the enter animation

  - `parent – {jQuery/jqLite element} –`

    the parent element of the element that will be the focus of the enter animation

  - `after – {jQuery/jqLite element} –`

    the sibling element (which is the previous element) of the element that will be the focus of the enter animation

- ### hide(element)

  Starts the hide animation first and sets the CSS `display` property to `none` upon completion.

  #### Parameters

  - `element – {jQuery/jqLite element} –`

    the element that will be rendered visible or hidden

- ### leave(element, parent)

  Runs the leave animation operation and, upon completion, removes the element from the DOM.

  #### Parameters

  - `element – {jQuery/jqLite element} –`

    the element that will be the focus of the leave animation

  - `parent – {jQuery/jqLite element} –`

    the parent element of the element that will be the focus of the leave animation

- ### move(element, parent, after)

  Fires the move DOM operation. Just before the animation starts, the animator will either append it into the parent container or add the element directly after the after element if present. Then the move animation will be run.

  #### Parameters

  - `element – {jQuery/jqLite element} –`

    the element that will be the focus of the move animation

  - `parent – {jQuery/jqLite element} –`

    the parent element of the element that will be the focus of the move animation

  - `after – {jQuery/jqLite element} –`

    the sibling element (which is the previous element) of the element that will be the focus of the move animation

- ### show(element)

  Reveals the element by setting the CSS property `display` to `block` and then starts the show animation directly after.

  #### Parameters

  - `element – {jQuery/jqLite element} –`

    the element that will be rendered visible or hidden