An implementation of the dependency injection helpers at Angular2 (2.0.0 compatible).
First you need to install the npm module:
npm install angular2-di-helper --save
In general, you don't need configure the providers at the main application module. You have to configure your providers at the main application module only if you use the Singleton annotation.
Use case #1
So, we should integrate the DI module at first.
Create the Action as a singleton instance via the factory using @Singleton decorator.
Create the Action2 instance every time as a new instance via the factory.
Use case #2
You have to configure your providers at the main application module using service locator only if you have a "special configuration" of providers, for example:
npm run deploy
Licensed under MIT.