ElementRef is an Angular dependency-injection token that provides a reference to the host DOM element for a directive or component instance. section 3.1.3
Its behavior follows Angular’s hierarchical injector model:
- Angular provides ElementRef through the directive’s ElementInjector. section 3.1.3
- Each application of the same directive can receive a different ElementRef instance. section 3.1.3
- Angular traverses the dependency and injector tree to resolve the reference. section 3.1.3
Figure 3.2 Diagram illustrating the hierarchy of injectors and dependencies
Use the injector-hierarchy diagram to trace how Angular resolves instance-specific dependencies. section 3.1.3
