From 12e79686dcac22a578c2f6cdde6e856ca3c9012c Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Wed, 26 May 2021 10:06:11 -0700 Subject: [PATCH] docs: clarify providedIn options (#42355) The list for the possible options of providedIn was not totally clear. This commit ensures each possible value is included explicitly in the docs. fixes #29330 PR Close #42355 --- packages/core/src/di/injectable.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/core/src/di/injectable.ts b/packages/core/src/di/injectable.ts index 7b1adf97c34..e3f7f305179 100644 --- a/packages/core/src/di/injectable.ts +++ b/packages/core/src/di/injectable.ts @@ -64,9 +64,15 @@ export interface InjectableDecorator { */ export interface Injectable { /** - * Determines which injectors will provide the injectable, - * by either associating it with an `@NgModule` or other `InjectorType`, - * or by specifying that this injectable should be provided in one of the following injectors: + * Determines which injectors will provide the injectable. + * + * - `Type` - associates the injectable with an `@NgModule` or other `InjectorType`, + * - 'null' : Equivalent to `undefined`. The injectable is not provided in any scope automatically + * and must be added to a `providers` array of an [@NgModule](api/core/NgModule#providers), + * [@Component](api/core/Directive#providers) or [@Directive](api/core/Directive#providers). + * + * The following options specify that this injectable should be provided in one of the following + * injectors: * - 'root' : The application-level injector in most apps. * - 'platform' : A special singleton platform injector shared by all * applications on the page.