Skip to content

Commit 8d0d6d9

Browse files
sonukapoorPawel Kozlowski
authored andcommitted
docs: rename duplicate header (#47110)
PR Close #47110
1 parent 01f5598 commit 8d0d6d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aio/content/guide/dependency-injection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class HeroService {}
5757

5858
When you provide the service at the root level, Angular creates a single, shared instance of the `HeroService` and injects it into any class that asks for it. Registering the provider in the `@Injectable` metadata also allows Angular to optimize an app by removing the service from the compiled application if it isn't used, a process known as tree-shaking.
5959

60-
## Providing dependency
60+
## Injecting a dependency
6161

6262
The most common way to inject a dependency is to declare it in a class constructor. When Angular creates a new instance of a component, directive, or pipe class, it determines which services or other dependencies that class needs by looking at the constructor parameter types. For example, if the `HeroListComponent` needs the `HeroService`, the constructor can look like this:
6363

0 commit comments

Comments
 (0)