What it does
Injector interface
How to use
Class Overview
class Injector {
staticTHROW_IF_NOT_FOUND
: _THROW_IF_NOT_FOUND
staticNULL
: Injector
get
(token: Type<T>|InjectionToken<T>, notFoundValue?: T) : T
}
Class Description
For more details, see the Dependency Injection Guide.
Example
Injector
returns itself when given Injector
as a token:
Class Details
get(token: Type<T>|InjectionToken<T>, notFoundValue?: T) : T
Retrieves an instance from the injector based on the provided token. If not found:
- Throws NoProviderError if no
notFoundValue
that is not equal to Injector.THROW_IF_NOT_FOUND is given - Returns the
notFoundValue
otherwise
exported from core/index, defined in core/src/di/injector.ts