# Class NgModule

Modules are collections of application configuration information for components: controllers, directives, filters, etc. They provide recipes for the injector to do the actual instantiation. A module itself has no behaviour but only state. A such, it acts as a data structure between the Angular instance and the injector service.

Since this is an internal structure that is exposed only via the Angular instance, it contains no validation of the items it receives. It is up to the instantiator on modules to do the actual validation.

##### Index

### Constructors

constructor

### Properties

configBlocks
invokeQueue
name
requires
runBlocks

### Methods

animation
component
config
constant
controller
decorator
directive
factory
filter
provider
run
service
value

## Constructors

### constructor

- new NgModule(name: string, requires: string[], configFn?: Injectable): NgModule

  #### Parameters

  - name: string

    Name of the module

  - requires: string[]

    List of modules which the injector will load before the current module

  - `Optional` configFn: Injectable

  #### Returns NgModule

## Properties

### configBlocks

configBlocks: any[][]

### invokeQueue

invokeQueue: any[][]

Holds a collection of tasks, required to instantiate an angular component

### name

name: string

Name of the current module.

### requires

requires: string[]

Array of module names that this module depends on.

### runBlocks

runBlocks: Injectable[]

## Methods

### animation

- animation(name: string, animationFactory: Injectable): NgModule

  #### Parameters

  - name: string
  - animationFactory: Injectable

  #### Returns NgModule

### component

- component(name: string, options: ComponentOptions): NgModule

  #### Parameters

  - name: string
  - options: ComponentOptions

  #### Returns NgModule

### config

- config(configFn: Injectable): NgModule

  #### Parameters

  - configFn: Injectable

  #### Returns NgModule

### constant

- constant(name: string, object: any): NgModule

  #### Parameters

  - name: string
  - object: any

  #### Returns NgModule

### controller

- controller(name: string, ctlFn: Injectable): NgModule

  #### Parameters

  - name: string
  - ctlFn: Injectable

  #### Returns NgModule

### decorator

- decorator(name: string, decorFn: Injectable): NgModule

  #### Parameters

  - name: string
  - decorFn: Injectable

  #### Returns NgModule

### directive

- directive(name: string, directiveFactory: Injectable): NgModule

  #### Parameters

  - name: string
  - directiveFactory: Injectable

  #### Returns NgModule

### factory

- factory(name: string, providerFunction: Injectable): NgModule

  #### Parameters

  - name: string
  - providerFunction: Injectable

  #### Returns NgModule

### filter

- filter(name: string, filterFn: Injectable): NgModule

  #### Parameters

  - name: string
  - filterFn: Injectable

  #### Returns NgModule

### provider

- provider(name: string, providerType: Injectable): NgModule

  #### Parameters

  - name: string
  - providerType: Injectable

  #### Returns NgModule

### run

- run(block: Injectable): NgModule

  #### Parameters

  - block: Injectable

  #### Returns NgModule

### service

- service(name: string, serviceFunction: Injectable): NgModule

  #### Parameters

  - name: string
  - serviceFunction: Injectable

  #### Returns NgModule

### value

- value(name: string, object: any): NgModule

  #### Parameters

  - name: string
  - object: any

  #### Returns NgModule