parent
7e3e77778d
commit
54b3634923
|
@ -369,7 +369,7 @@ include ../../../../_includes/_util-fns
|
|||
That list of classes is actually a list of **providers**.
|
||||
|
||||
"Providers" create the instances of the things that we ask the injector to inject.
|
||||
There are many ways ways to "provide" a thing that has the necessary shape and behavior to serve as a `HeroService`.
|
||||
There are many ways to "provide" a thing that has the necessary shape and behavior to serve as a `HeroService`.
|
||||
A class is a natural provider - it's meant to be created. But it's not the only way
|
||||
to produce something injectable. We could hand the injector an object to return. We could give it a factory function to call.
|
||||
Any of these approaches might be a good choice under the right circumstances.
|
||||
|
|
Loading…
Reference in New Issue