angularangular2-di

How to use angular DI separately


This article states that:

The existing DI (angular1) has some problem though:

Built into the framework - Angular 1’s DI is baked right into the framework. There’s no way for us to use it decoupled as a standalone system.

How can I use angular2 DI as a standalone system? It's not published as a separate package as I understand.


Solution

  • It was previously possible to import it from @angular/core. It is published as a separate package, injection-js, by a member of Angular team.

    Also see this answer.