docs: rename duplicate header (#47110)

PR Close #47110
This commit is contained in:
Sonu Kapoor
2022-08-10 09:08:35 -04:00
committed by Pawel Kozlowski
parent c365cfab03
commit bb40a08164
+1 -1
View File
@@ -57,7 +57,7 @@ class HeroService {}
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.
## Providing dependency
## Injecting a dependency
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: