[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/core/DestroyableInjector [Back]  [Original]

DestroyableInjector Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/core

DestroyableInjector

interface
stable

An Injector that the owner can destroy and trigger the DestroyRef.destroy hooks.

On this page

    arrow_upward_alt Back to the top

    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
    @returnsvoid

    get

    4 overloads

    Retrieves an instance from the injector based on the provided token.

    @paramtokenProviderToken<T>
    @paramnotFoundValueundefined
    @paramoptionsInjectOptions & { optional?: false | undefined; }
    @returnsT

    The 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 | null

    The 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
    @returnsT

    The instance from the injector if defined, otherwise the notFoundValue.

    @deprecated

    from v4.0.0 use ProviderToken

    @paramtokenstring | ProviderToken<T>
    @paramnotFoundValueany
    @returnsany
    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page