p.location-badge.
exported from angular2/di
defined in angular2/src/core/di/injector.ts (line 373)
:markdown
The `di` module provides dependency injection container services.
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(_proto: ProtoInjector, _parent?: Injector, _depProvider?: DependencyProvider, _debugContext?: Function)
:markdown
.l-sub-section
h3 debugContext
pre.prettyprint
code.
debugContext()
:markdown
Returns debug information about the injector.
This information is included into exceptions thrown by the injector.
.l-sub-section
h3 get
pre.prettyprint
code.
get(token: any)
:markdown
Retrieves an instance from the injector.
.l-sub-section
h3 getOptional
pre.prettyprint
code.
getOptional(token: any)
:markdown
Retrieves an instance from the injector.
.l-sub-section
h3 getAt
pre.prettyprint
code.
getAt(index: number)
:markdown
Retrieves an instance from the injector.
.l-sub-section
h3 parent
:markdown
Direct parent of this injector.
.l-sub-section
h3 internalStrategy
:markdown
Internal. Do not use.
We return `any` not to export the InjectorStrategy type.
.l-sub-section
h3 resolveAndCreateChild
pre.prettyprint
code.
resolveAndCreateChild(bindings: Array<Type | Binding | any[]>, depProvider?: DependencyProvider)
:markdown
Creates a child injector and loads a new set of bindings into it.
A resolution is a process of flattening multiple nested lists and converting individual
bindings into a list of ResolvedBinding
s. The resolution can be cached by `resolve`
for the Injector
for performance-sensitive code.
.l-sub-section
h3 createChildFromResolved
pre.prettyprint
code.
createChildFromResolved(bindings: ResolvedBinding[], depProvider?: DependencyProvider)
:markdown
Creates a child injector and loads a new set of ResolvedBinding
s into it.
.l-sub-section
h3 resolveAndInstantiate
pre.prettyprint
code.
resolveAndInstantiate(binding: Type | Binding)
:markdown
Resolves a binding and instantiates an object in the context of the injector.
.l-sub-section
h3 instantiateResolved
pre.prettyprint
code.
instantiateResolved(binding: ResolvedBinding)
:markdown
Instantiates an object using a resolved bindin in the context of the injector.
.l-sub-section
h3 displayName
:markdown
.l-sub-section
h3 toString
pre.prettyprint
code.
toString()
:markdown