-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #609 from ReliefApplications/dev-refactor-models
Dev refactor models
- Loading branch information
Showing
338 changed files
with
15,814 additions
and
16,257 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {Injector} from '@angular/core'; | ||
|
||
/** | ||
* Allows for retrieving singletons using `AppInjector.get(MyService)` (whereas | ||
* `ReflectiveInjector.resolveAndCreate(MyService)` would create a new instance | ||
* of the service). | ||
*/ | ||
export let AppInjector: Injector; | ||
|
||
/** | ||
* Helper to set the exported {@link AppInjector}, needed as ES6 modules export | ||
* immutable bindings (see http://2ality.com/2015/07/es6-module-exports.html) for | ||
* which trying to make changes after using `import {AppInjector}` would throw: | ||
* "TS2539: Cannot assign to 'AppInjector' because it is not a variable". | ||
*/ | ||
export function setAppInjector(injector: Injector) { | ||
if (AppInjector) { | ||
// Should not happen | ||
console.error('Programming error: AppInjector was already set'); | ||
} | ||
else { | ||
AppInjector = injector; | ||
} | ||
} |
This file contains 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
This file contains 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
Oops, something went wrong.