parent
f24fd56ed1
commit
4f0110e75a
@ -105,8 +105,8 @@ and leave it up to the app whether to provide the service.
|
|||||||
|
|
||||||
### @NgModule-level injectors
|
### @NgModule-level injectors
|
||||||
|
|
||||||
You can configure a provider at the module level using the `providedIn` metadata option for a non-root NgModule, in order to limit the scope of the provider to that module.
|
You can configure a provider at the module level using the `providers` metadata option for a non-root NgModule, in order to limit the scope of the provider to that module.
|
||||||
This is the equivalent of specifying the non-root module in the `@Injectable()` metadata, except that the service provided this way is not tree-shakable.
|
This is the equivalent of specifying the non-root module in the `@Injectable()` metadata, except that the service provided via `providers` is not tree-shakable.
|
||||||
|
|
||||||
You generally don't need to specify `AppModule` with `providedIn`, because the app's `root` injector is the `AppModule` injector.
|
You generally don't need to specify `AppModule` with `providedIn`, because the app's `root` injector is the `AppModule` injector.
|
||||||
However, if you configure a app-wide provider in the `@NgModule()` metadata for `AppModule`,
|
However, if you configure a app-wide provider in the `@NgModule()` metadata for `AppModule`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user