mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
Update dependency-injection.md (#61019)
Fixed list of ways to do dependency injection. PR Close #61019
This commit is contained in:
@@ -22,14 +22,10 @@ class HeroService {}
|
||||
The next step is to make it available in the DI by providing it.
|
||||
A dependency can be provided in multiple places:
|
||||
|
||||
- [Understanding dependency injection](#understanding-dependency-injection)
|
||||
- [Providing a dependency](#providing-a-dependency)
|
||||
- [**Preferred**: At the application root level using `providedIn`](#preferred-at-the-application-root-level-using-providedin)
|
||||
- [At the Component level](#at-the-component-level)
|
||||
- [At the application root level using `ApplicationConfig`](#at-the-application-root-level-using-applicationconfig)
|
||||
- [`NgModule` based applications](#ngmodule-based-applications)
|
||||
- [Injecting/consuming a dependency](#injectingconsuming-a-dependency)
|
||||
- [What's next](#whats-next)
|
||||
- [**Preferred**: At the application root level using `providedIn`](#preferred-at-the-application-root-level-using-providedin)
|
||||
- [At the Component level](#at-the-component-level)
|
||||
- [At the application root level using `ApplicationConfig`](#at-the-application-root-level-using-applicationconfig)
|
||||
- [`NgModule` based applications](#ngmodule-based-applications)
|
||||
|
||||
### **Preferred**: At the application root level using `providedIn`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user