docs: clarifies how the service is injected (#34638)
There was some confusion about how the service will be injected in the sentence with the `new` keyword. This PR should hopefully clear the confusion. Fixes #34612 PR Close #34638
This commit is contained in:
parent
8942b7106d
commit
02baaa4813
|
@ -11,7 +11,7 @@ Components shouldn't fetch or save data directly and they certainly shouldn't kn
|
||||||
They should focus on presenting data and delegate data access to a service.
|
They should focus on presenting data and delegate data access to a service.
|
||||||
|
|
||||||
In this tutorial, you'll create a `HeroService` that all application classes can use to get heroes.
|
In this tutorial, you'll create a `HeroService` that all application classes can use to get heroes.
|
||||||
Instead of creating that service with `new`,
|
Instead of creating that service with the [`new` keyword](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new),
|
||||||
you'll rely on Angular [*dependency injection*](guide/dependency-injection)
|
you'll rely on Angular [*dependency injection*](guide/dependency-injection)
|
||||||
to inject it into the `HeroesComponent` constructor.
|
to inject it into the `HeroesComponent` constructor.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue