Module
ng
Interface for configuring angular modules.
NOTE: animations take effect only if the ngAnimate module is loaded.
Defines an animation hook that can be later used with $animate service and directives that use this service.
module.animation('.animation-name', function($inject1, $inject2) {
return {
eventName : function(element, done) {
//code to run the animation
//once complete, then run done()
return function cancellationFunction(element) {
//code to cancel the animation
}
}
}
})
See $animateProvider.register() and ngAnimate module for more information.
| Param | Type | Details |
|---|---|---|
| name | string | animation name |
| animationFactory | Function | Factory function for creating new instance of an animation. |
Use this method to register work which needs to be performed on module loading.
| Param | Type | Details |
|---|---|---|
| configFn | Function | Execute this function on module load. Useful for service configuration. |
Because the constant are fixed, they get applied before other provide methods.
See $provide.constant().
| Param | Type | Details |
|---|---|---|
| name | string | constant name |
| object | * | Constant value. |
See $provide.factory().
| Param | Type | Details |
|---|---|---|
| name | string | service name |
| providerFunction | Function | Function for creating new instance of the service. |
See $provide.provider().
| Param | Type | Details |
|---|---|---|
| name | string | service name |
| providerType | Function | Construction function for creating new instance of the service. |
Use this method to register work which should be performed when the injector is done loading all modules.
| Param | Type | Details |
|---|---|---|
| initializationFn | Function | Execute this function after injector creation. Useful for application initialization. |
See $provide.service().
| Param | Type | Details |
|---|---|---|
| name | string | service name |
| constructor | Function | A constructor function that will be instantiated. |
See $provide.value().
| Param | Type | Details |
|---|---|---|
| name | string | service name |
| object | * | Service instance object. |
| string | Name of the module. |
Holds the list of modules which the injector will load before the current module is loaded.
| Array.<string> | List of module names which must be loaded before this module. |