Home Identifier Source
import {Injector} from 'injector/lib/injector.js'
public class | source

Injector

Static Method Summary

Static Public Methods
public static

Start the binding resolution

public static

This is an injector Factory

Constructor Summary

Public Constructor
public

constructor(resolvedBindings: ResolvedBinding, parent: Injector)

This is an Injector

Member Summary

Public Members
public

parent: *

public

Method Summary

Public Methods
public

get(token: String): Object

Return the factory execution value if the key matches

public

parseDependencies(dependencies: Object): Object

Split dependencies in an array of object

public

resolveConstructor(resolvedBinding: ResolvedBinding, dependencies: Object): Object

Resolve the constructor injector

public

Resolve the dependencies of the resolvedBinding

public

resolveProperty(newInstance: Object): Object

Resolve properties injection

public

resolveSetters(newInstance: Object): Object

Resolve setters injection

Static Public Methods

public static resolve(bindings: Binding): ResolvedBinding source

Start the binding resolution

Params:

NameTypeAttributeDescription
bindings Binding

An array of bindings to resolve

Return:

ResolvedBinding

The array of resolvedBinding obtained

public static resolveAndCreate(bindings: Binding): Injector source

This is an injector Factory

Params:

NameTypeAttributeDescription
bindings Binding

List of the bindings to resolve

Return:

Injector

The new injector created

Public Constructors

public constructor(resolvedBindings: ResolvedBinding, parent: Injector) source

This is an Injector

Params:

NameTypeAttributeDescription
resolvedBindings ResolvedBinding

The resolved binding of the injector

parent Injector

The parent injector

Public Members

public parent: * source

public resolvedBindings: * source

Public Methods

public get(token: String): Object source

Return the factory execution value if the key matches

Params:

NameTypeAttributeDescription
token String

The key of the resolvedBinding factory to get

Return:

Object

The value corresponding to the factory execution

public parseDependencies(dependencies: Object): Object source

Split dependencies in an array of object

Params:

NameTypeAttributeDescription
dependencies Object

An array of dependencies

Return:

Object

An array of dependencies splitted into 3 category inConstructor, inProperty, inSetter

public resolveConstructor(resolvedBinding: ResolvedBinding, dependencies: Object): Object source

Resolve the constructor injector

Params:

NameTypeAttributeDescription
resolvedBinding ResolvedBinding

The resolved binding to loaded

dependencies Object

The dependencies to inject

Return:

Object

Return the object instance with constructor dependencies

public resolveDependencies(resolvedBinding: ResolvedBinding): Object source

Resolve the dependencies of the resolvedBinding

Params:

NameTypeAttributeDescription
resolvedBinding ResolvedBinding

The resolved binding concerned

Return:

Object

The factory execution loaded

public resolveProperty(newInstance: Object): Object source

Resolve properties injection

Params:

NameTypeAttributeDescription
newInstance Object

The object instance where to inject properties

Return:

Object

The object with property injected

public resolveSetters(newInstance: Object): Object source

Resolve setters injection

Params:

NameTypeAttributeDescription
newInstance Object

The object where to make setter injection

Return:

Object

The object with setters injected