DestroyableInjector
interfacestablecodeAn Injector that the owner can destroy and trigger the DestroyRef.destroy hooks.
API
interface DestroyableInjector extends Injector {}
destroy
void@returnsvoidget
4 overloadsRetrieves an instance from the injector based on the provided token.
@paramtokenProviderToken<T>@paramnotFoundValueundefined@paramoptionsInjectOptions & { optional?: false | undefined; }@returnsTThe instance from the injector if defined, otherwise the notFoundValue.
Retrieves an instance from the injector based on the provided token.
@paramtokenProviderToken<T>@paramnotFoundValuenull | undefined@paramoptionsInjectOptions@returnsT | nullThe instance from the injector if defined, otherwise the notFoundValue.
Retrieves an instance from the injector based on the provided token.
@paramtokenProviderToken<T>@paramnotFoundValueT | undefined@paramoptionsInjectOptions | undefined@returnsTThe instance from the injector if defined, otherwise the notFoundValue.
from v4.0.0 use ProviderToken
@paramtokenstring | ProviderToken<T>@paramnotFoundValueany@returnsany