# `animation` ( global in module `ng` )

## Description

Defines an animation hook that can be later used with `ngAnimate` alongside `common ng directives` as well as custom directives.

    module.animation('animation-name', function($inject1, $inject2) {
      return {
        //this gets called in preparation to setup an animation
        setup : function(element) { ... },

        //this gets called once the animation is run
        start : function(element, done, memo) { ... }
      }
    })

See `$animationProvider.register()` and `ngAnimate` for more information.

## Parameters

- `name – {string} –`

  animation name

- `animationFactory – {Function} –`

  Factory function for creating new instance of an animation.