EnvironmentInjector
An Injector that's part of the environment injector hierarchy, which exists outside of the
component tree.
get
4 overloadsRetrieves an instance from the injector based on the provided token.
undefinedTThe instance from the injector if defined, otherwise the notFoundValue.
Retrieves an instance from the injector based on the provided token.
null | undefinedT | nullThe instance from the injector if defined, otherwise the notFoundValue.
Retrieves an instance from the injector based on the provided token.
T | undefinedTThe instance from the injector if defined, otherwise the notFoundValue.
runInContext
ReturnTRuns the given function in the context of this EnvironmentInjector.
Within the function's stack frame, inject can be used to inject
dependencies from this injector. Note that inject is only usable synchronously, and cannot be
used in any asynchronous callbacks or after any await points.
() => ReturnTthe closure to be run in the context of this injector
ReturnTthe return value of the function, if any
destroy
voidvoiddestroyed
booleanIndicates whether the instance has already been destroyed.