DestroyableInjector
An Injector that the owner can destroy and trigger the DestroyRef.destroy hooks.
API
interface DestroyableInjector extends Injector {
destroy(): void;
abstract override get<T>(token: ProviderToken<T>, notFoundValue: undefined, options: InjectOptions & { optional?: false | undefined; }): T;
abstract override get<T>(token: ProviderToken<T>, notFoundValue: null | undefined, options: InjectOptions): T | null;
abstract override get<T>(token: ProviderToken<T>, notFoundValue?: T | undefined, options?: InjectOptions | undefined): T;
abstract override get<T>(token: string | ProviderToken<T>, notFoundValue?: any): any;
}
destroy
void
@returns
void
get
4 overloadsRetrieves an instance from the injector based on the provided token.
@paramnotFoundValue
undefined
@returns
TThe instance from the injector if defined, otherwise the notFoundValue.
Retrieves an instance from the injector based on the provided token.
@paramnotFoundValue
null | undefined
@returns
T | nullThe instance from the injector if defined, otherwise the notFoundValue.
Retrieves an instance from the injector based on the provided token.
@paramnotFoundValue
T | undefined
@returns
TThe instance from the injector if defined, otherwise the notFoundValue.
Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/core/DestroyableInjector