Skip to content

Commit f32ff43

Browse files
author
Vasile D
committed
minor edits
1 parent 0a9003d commit f32ff43

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -703,20 +703,21 @@ You can download the PDF and Epub version of this repository from the latest run
703703
#### Angular has two injector hierarchies:
704704
![Screenshot](/images/injector%20hierarchies.png)
705705
706-
- __Module injector__
706+
#### Module injector
707707
When angular starts, it creates a root injector where the services will be registered, these are provided via injectable annotation. All services provided in the `ng-model` property are called providers (if those modules are not lazy-loaded).
708708
709709
Angular recursively goes through all models which are being used in the application and creates instances for provided services in the root injector. If you provide some service in an eagerly-loaded model, the service will be added to the root injector, which makes it available across the whole application.
710710
711-
- __Platform Module__
711+
#### Platform Module
712712
During application bootstrapping angular creates a few more injectors, above the root injector goes the platform injector, this one is created by the platform browser dynamic function inside the `main.ts` file, and it provides some platform-specific features like `DomSanitizer`.
713713
714-
- __NullInjector()__
714+
#### NullInjector()
715715
At the very top, the next parent injector in the hierarchy is the `NullInjector()`.The responsibility of this injector is to throw the error if something tries to find dependencies there, unless you've used `@Optional()` because ultimately, everything ends at the `NullInjector()` and it returns an error or, in the case of `@Optional()`, `null`.
716716
717717
![Screenshot](images/hierarchy%20diagram.png)
718718
719-
- __ElementInjector__
719+
720+
#### ElementInjector
720721
Angular creates `ElementInjector` hierarchies implicitly for each DOM element. `ElementInjector` injector is being created for any tag that matches the angular component, or any tag on which directive is applied, and you can configure it in component and directive annotations inside the provider's property, thus, it creates its own hierarchy likewise the upper one.
721722
722723
![Screenshot](images/element%20injector%20hieracrhy.png)

0 commit comments

Comments
 (0)