fix(upgrade): Update types for TypeScript nullability support
Closes #15897
This commit is contained in:

committed by
Tobias Bosch

parent
a0d124bd91
commit
01d93f3af8
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user