Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Understanding the Angular Injector

Understanding the Angular Injector

One of the most powerful features in Angular is the dependency injection mechanism. You're just adding a provider inside your class constructor, and you getting the instance from Angular. Angular 9 introduced new way to register providers on any module level, and on the platform level. Let learn together how the DI works behind the scene. What are tree shakable providers and why we need new levels for registering them?

Eliran Eliassy

May 07, 2020
Tweet

More Decks by Eliran Eliassy

Other Decks in Technology

Transcript

  1. e-square.io — Founder & CEO @ e-square.io — GDE for

    Angular & Web Technologies — Writer for AngularInDepth — Community leader About mySelf
  2. e-square.io providedIn levels • ‘root’: The application-level injector in most

    apps. • ‘any’: Provides a unique instance in every module (including lazy modules) that injects the token. • ‘platform’: A special singleton platform injector shared by all applications on the page.