
@Injectable() supports a scope parameter which specifies the target module. However, it's still difficult to specify that a particular service belongs in the root injector. A developer attempting to ensure that must either also provide a module intended for placement in the root injector or target a module known to already be in the root injector (e.g. BrowserModule). Both of these strategies are cumbersome and brittle. Instead, this commit adds a token APP_ROOT_SCOPE which provides a straightforward way of targeting the root injector directly, without requiring special knowledge of modules within it. PR Close #22185
27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
/**
|
|
* @module
|
|
* @description
|
|
* The `di` module provides dependency injection container services.
|
|
*/
|
|
|
|
export * from './di/metadata';
|
|
export {defineInjectable, Injectable, InjectableDecorator, InjectableProvider, InjectableType} from './di/injectable';
|
|
|
|
export {forwardRef, resolveForwardRef, ForwardRefFn} from './di/forward_ref';
|
|
|
|
export {InjectFlags, Injector} from './di/injector';
|
|
export {ReflectiveInjector} from './di/reflective_injector';
|
|
export {StaticProvider, ValueProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ClassProvider} from './di/provider';
|
|
export {ResolvedReflectiveFactory, ResolvedReflectiveProvider} from './di/reflective_provider';
|
|
export {ReflectiveKey} from './di/reflective_key';
|
|
export {InjectionToken} from './di/injection_token';
|
|
export {APP_ROOT_SCOPE} from './di/scope';
|