# `Module` (Type in module `ng` )

Improve this doc

## Description

Interface for configuring angular `modules`.

## Methods

- ### animation(name, animationFactory)

  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.

- ### config(configFn)

  Use this method to register work which needs to be performed on module loading.

  #### Parameters

  - `configFn – {Function} –`

    Execute this function on module load. Useful for service configuration.

- ### constant(name, object)

  Because the constant are fixed, they get applied before other provide methods. See `$provide.constant()`.

  #### Parameters

  - `name – {string} –`

    constant name

  - `object – {*} –`

    Constant value.

- ### controller(name, constructor)

  See `$controllerProvider.register()`.

  #### Parameters

  - `name – {string} –`

    Controller name.

  - `constructor – {Function} –`

    Controller constructor function.

- ### directive(name, directiveFactory)

  See `$compileProvider.directive()`.

  #### Parameters

  - `name – {string} –`

    directive name

  - `directiveFactory – {Function} –`

    Factory function for creating new instance of directives.

- ### factory(name, providerFunction)

  See `$provide.factory()`.

  #### Parameters

  - `name – {string} –`

    service name

  - `providerFunction – {Function} –`

    Function for creating new instance of the service.

- ### filter(name, filterFactory)

  See `$filterProvider.register()`.

  #### Parameters

  - `name – {string} –`

    Filter name.

  - `filterFactory – {Function} –`

    Factory function for creating new instance of filter.

- ### provider(name, providerType)

  See `$provide.provider()`.

  #### Parameters

  - `name – {string} –`

    service name

  - `providerType – {Function} –`

    Construction function for creating new instance of the service.

- ### run(initializationFn)

  Use this method to register work which should be performed when the injector is done loading all modules.

  #### Parameters

  - `initializationFn – {Function} –`

    Execute this function after injector creation. Useful for application initialization.

- ### service(name, constructor)

  See `$provide.service()`.

  #### Parameters

  - `name – {string} –`

    service name

  - `constructor – {Function} –`

    A constructor function that will be instantiated.

- ### value(name, object)

  See `$provide.value()`.

  #### Parameters

  - `name – {string} –`

    service name

  - `object – {*} –`

    Service instance object.

## Properties

- ### name

  #### Returns

  `{string}` –

  Name of the module.

- ### requires

  Holds the list of modules which the injector will load before the current module is loaded.

  #### Returns

  `{Array.<string>}` –

  List of module names which must be loaded before this module.