Climbing up injector trees
summary
Live demo builds an Angular app in StackBlitz and shows that dependency lookup happens in two distinct trees: first the ElementInjector tree (component providers and DOM ancestry), then the ModuleInjector tree (NgModule providers), with lazy-loaded modules creating their own injectors. Content projection outcome surprises: projected nodes resolve against where they end up in the DOM, not where their template sits. Examples use Angular CLI snippets and StackBlitz; the demo runs, hits small errors, and is fixed live. Links and samples are at https://go.urish.org/injector-trees ModuleInjector
AI-written summary · about
chapters (4)
- 0:00Angular injector basics
- 9:17Content projection
- 14:52Module injector trees
- 22:27Lazy loading and summary
related talks
46mAngular Dependency Injection – Understanding hierarchical injectors
57mAngular Dependency Injection, In Depth
01h 00mAngular Dependency Injection In-Depth
17mDissecting Dependency Injection: Angular and NestJS
29mDI Deep Dive
39mDeep DI-ving: how Angular's DI system defeated a monolith
39mSimplifying DI and Services in Angular
38mDependency Injection for Future Generations
