Created
October 29, 2017 02:08
-
-
Save SaurabhLpRocks/ba8a9cd00ecd5dc56996af97159f2306 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class AppModule { | |
| /** | |
| * Allows for retrieving singletons using `AppModule.injector.get(MyService)` | |
| * This is good to prevent injecting the service as constructor parameter. | |
| */static injector: Injector; | |
| constructor(public appState: AppState, injector: Injector) { | |
| AppModule.injector = injector; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment