CodeZettaInterview Hub

Angular · Dependency Injection · Junior · Architecture

Explain hierarchical injectors in a routed Angular app.

Short Interview Answer

Root → platform/app → lazy route injectors → component injectors form a lookup chain.

Detailed Explanation

Lazy routes get their own injector for provided services. Element injectors (directives/components) participate too. Understanding the chain explains 'NullInjectorError' and unexpected singletons.

Did you know this answer?