X Tutup
Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions aio/content/guide/dependency-injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class HeroListComponent {}

When you register a provider at the component level, you get a new instance of the service with each new instance of that component.

* At the NgModule level, using the `providers` field of the `@NgModule` decorator. In this scenario, the `HeroService` is available to all components, directives, and pipes declared in this NgModule or other NgModule which is within same ModuleInjector applicable for this NgModule. When you register a provider with a specific NgModule, the same instance of a service is available to all applicable components, directives and pipes.
* At the NgModule level, using the `providers` field of the `@NgModule` decorator. In this scenario, the `HeroService` is available to all components, directives, and pipes declared in this NgModule or other NgModule which is within the same ModuleInjector applicable for this NgModule. When you register a provider with a specific NgModule, the same instance of a service is available to all applicable components, directives and pipes.
To understand all edge-cases, see [Hierarchical injectors](guide/hierarchical-dependency-injection). For example:


Expand Down Expand Up @@ -81,4 +81,4 @@ When all requested services have been resolved and returned, Angular can call th
* [Creating and injecting services](guide/creating-injectable-service)
* [Dependency Injection in Action](guide/dependency-injection-in-action)

@reviewed 2022-08-02
@reviewed 2023-05-16
X Tutup