fix(upgrade): Update types for TypeScript nullability support

Closes #15897
This commit is contained in:
Miško Hevery
2017-03-24 09:59:18 -07:00
committed by Tobias Bosch
parent a0d124bd91
commit 01d93f3af8
14 changed files with 134 additions and 129 deletions

View File

@ -12,12 +12,12 @@ import * as angular from '../common/angular1';
// We store the ng1 injector so that the provider in the module injector can access it
// Then we "get" the ng1 injector from the module injector, which triggers the provider to read
// the stored injector and release the reference to it.
let tempInjectorRef: angular.IInjectorService;
let tempInjectorRef: angular.IInjectorService|null;
export function setTempInjectorRef(injector: angular.IInjectorService) {
tempInjectorRef = injector;
}
export function injectorFactory() {
const injector: angular.IInjectorService = tempInjectorRef;
const injector: angular.IInjectorService|null = tempInjectorRef;
tempInjectorRef = null; // clear the value to prevent memory leaks
return injector;
}