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

Improve this doc

## Description

The $AnimationProvider provider allows developers to register and access custom JavaScript animations directly inside of a module.

## Methods

- ### register(name, factory)

  Registers a new injectable animation factory function. The factory function produces the animation object which has these two properties:

  - `setup`: `function(Element):*` A function which receives the starting state of the element. The purpose of this function is to get the element ready for animation. Optionally the function returns an memento which is passed to the `start` function.
  - `start`: `function(Element, doneFunction, *)` The element to animate, the `doneFunction` to be called on element animation completion, and an optional memento from the `setup` function.

  #### Parameters

  - `name – {string} –`

    The name of the animation.

  - `factory – {function} –`

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