public class IModule extends Objs
Objs.Constructor<T extends Objs>, Objs.Property<T>
Modifier and Type | Field and Description |
---|---|
Objs.Property<String> |
name |
Objs.Property<String[]> |
requires |
Modifier | Constructor and Description |
---|---|
protected |
IModule(Objs.Constructor<?> c,
Object js) |
Modifier and Type | Method and Description |
---|---|
static IModule |
$as(Object obj) |
IModule |
component(String name,
IComponentOptions options)
Use this method to register a component.
|
IModule |
config(Function configFn)
Use this method to register work which needs to be performed on module loading.
|
IModule |
config(Object[] inlineAnnotatedFunction)
Use this method to register work which needs to be performed on module loading.
|
IModule |
config(Objs object) |
IModule |
constant(Objs object) |
IModule |
constant(String name,
Object value)
Register a constant service, such as a string, a number, an array, an object or a function, with the $injector.
|
IModule |
controller(Objs object) |
IModule |
controller(String name,
Function controllerConstructor)
The $controller service is used by Angular to create new controllers.
|
IModule |
controller(String name,
Object[] inlineAnnotatedConstructor)
The $controller service is used by Angular to create new controllers.
|
IModule |
decorator(String name,
Function decoratorConstructor)
Register a service decorator with the $injector.
|
IModule |
decorator(String name,
Object[] inlineAnnotatedConstructor) |
IModule |
directive(Objs object) |
IModule |
directive(String name,
IDirectiveFactory directiveFactory)
Register a new directive with the compiler.
|
IModule |
directive(String name,
Object[] inlineAnnotatedFunction)
Register a new directive with the compiler.
|
IModule |
factory(Objs object) |
IModule |
factory(String name,
Function $getFn)
Register a service factory, which will be called to return the service instance.
|
IModule |
factory(String name,
Object[] inlineAnnotatedFunction)
Register a service factory, which will be called to return the service instance.
|
IModule |
filter(Objs object) |
IModule |
filter(String name,
Function filterFactoryFunction) |
IModule |
filter(String name,
Object[] inlineAnnotatedFunction) |
String |
name() |
IModule |
provider(Objs object) |
IModule |
provider(String name,
IServiceProvider providerObject) |
IModule |
provider(String name,
IServiceProviderClass serviceProviderConstructor) |
IModule |
provider(String name,
IServiceProviderFactory serviceProviderFactory) |
IModule |
provider(String name,
Object[] inlineAnnotatedConstructor) |
String[] |
requires() |
IModule |
run(Function initializationFunction)
Run blocks are the closest thing in Angular to the main method.
|
IModule |
run(Object[] inlineAnnotatedFunction)
Run blocks are the closest thing in Angular to the main method.
|
IModule |
service(Objs object) |
IModule |
service(String name,
Function serviceConstructor)
Register a service constructor, which will be invoked with new to create the service instance.
|
IModule |
service(String name,
Object[] inlineAnnotatedConstructor)
Register a service constructor, which will be invoked with new to create the service instance.
|
IModule |
value(Objs object) |
IModule |
value(String name,
Object value)
Register a value service with the $injector, such as a string, a number, an array, an object or a function.
|
$as, $cast, $delete, $get, $js, $set, create, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor, getOwnPropertyNames, getPrototypeOf, hasOwnProperty, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, newObject, newObject, preventExtensions, propertyIsEnumerable, seal, toLocaleString, toString, valueOf
public Objs.Property<String> name
public Objs.Property<String[]> requires
protected IModule(Objs.Constructor<?> c, Object js)
public String name()
public String[] requires()
public IModule component(String name, IComponentOptions options)
name
- The name of the component.options
- A definition object passed into the component.public IModule config(Object[] inlineAnnotatedFunction)
inlineAnnotatedFunction
- Execute this function on module load. Useful for service configuration.public IModule config(Function configFn)
configFn
- Execute this function on module load. Useful for service configuration.public IModule constant(String name, Object value)
name
- The name of the constant.value
- The constant value.public IModule controller(String name, Object[] inlineAnnotatedConstructor)
name
- Controller name, or an object map of controllers where the keys are the names and the values are the constructors.controllerConstructor
- Controller constructor fn (optionally decorated with DI annotations in the array notation).public IModule controller(String name, Function controllerConstructor)
name
- Controller name, or an object map of controllers where the keys are the names and the values are the constructors.controllerConstructor
- Controller constructor fn (optionally decorated with DI annotations in the array notation).public IModule decorator(String name, Function decoratorConstructor)
name
- The name of the service to decoratedecorator
- This function will be invoked when the service needs to be instantiated and should return the decorated service instance. The function is called using the injector.invoke method and is therefore fully injectable. Local injection arguments: $delegate - The original service instance, which can be monkey patched, configured, decorated or delegated to.public IModule directive(String name, Object[] inlineAnnotatedFunction)
name
- Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)directiveFactory
- An injectable directive factory function.public IModule directive(String name, IDirectiveFactory directiveFactory)
name
- Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)directiveFactory
- An injectable directive factory function.public IModule factory(String name, Object[] inlineAnnotatedFunction)
name
- The name of the instance.inlineAnnotatedFunction
- The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).public IModule factory(String name, Function $getFn)
name
- The name of the instance.$getFn
- The $getFn for the instance creation. Internally this is a short hand for $provide.provider(name, {$get: $getFn}).public IModule provider(String name, IServiceProvider providerObject)
public IModule provider(String name, IServiceProviderClass serviceProviderConstructor)
public IModule provider(String name, IServiceProviderFactory serviceProviderFactory)
public IModule run(Object[] inlineAnnotatedFunction)
public IModule run(Function initializationFunction)
public IModule service(String name, Object[] inlineAnnotatedConstructor)
name
- The name of the instance.inlineAnnotatedConstructor
- An injectable class (constructor function) that will be instantiated.public IModule service(String name, Function serviceConstructor)
name
- The name of the instance.serviceConstructor
- An injectable class (constructor function) that will be instantiated.public IModule value(String name, Object value)
name
- The name of the instance.value
- The value.Copyright © 2018. All rights reserved.