InjectionToken
InjectionToken
Stable Class
Class Overview
class InjectionToken extends OpaqueToken { constructor(desc: string) toString() : string }
Class Description
Creates a token that can be used in a DI Provider.
Use an InjectionToken
whenever the type you are injecting is not reified (does not have a runtime representation) such as when injecting an interface, callable type, array or parametrized type.
InjectionToken
is parametrize on T
which is the type of object which will be returned by the Injector
. This provides additional level of type safety.
登录查看完整内容