diff --git a/packages/upgrade/src/dynamic/upgrade_adapter.ts b/packages/upgrade/src/dynamic/upgrade_adapter.ts index faa4ab43ec..d404dbada8 100644 --- a/packages/upgrade/src/dynamic/upgrade_adapter.ts +++ b/packages/upgrade/src/dynamic/upgrade_adapter.ts @@ -13,7 +13,7 @@ import * as angular from '../common/angular1'; import {$$TESTABILITY, $COMPILE, $INJECTOR, $ROOT_SCOPE, COMPILER_KEY, INJECTOR_KEY, LAZY_MODULE_REF, NG_ZONE_KEY} from '../common/constants'; import {downgradeComponent} from '../common/downgrade_component'; import {downgradeInjectable} from '../common/downgrade_injectable'; -import {Deferred, controllerKey, onError} from '../common/util'; +import {Deferred, LazyModuleRef, controllerKey, onError} from '../common/util'; import {UpgradeNg1ComponentAdapterBuilder} from './upgrade_ng1_adapter'; @@ -498,7 +498,10 @@ export class UpgradeAdapter { ng1Module.factory(INJECTOR_KEY, () => this.moduleRef !.injector.get(Injector)) .factory( LAZY_MODULE_REF, - [INJECTOR_KEY, (injector: Injector) => ({injector, needsInNgZone: false})]) + [ + INJECTOR_KEY, + (injector: Injector) => ({ injector, needsNgZone: false } as LazyModuleRef) + ]) .constant(NG_ZONE_KEY, this.ngZone) .factory(COMPILER_KEY, () => this.moduleRef !.injector.get(Compiler)) .config([ diff --git a/packages/upgrade/src/static/upgrade_module.ts b/packages/upgrade/src/static/upgrade_module.ts index 1c57528350..e93305e0df 100644 --- a/packages/upgrade/src/static/upgrade_module.ts +++ b/packages/upgrade/src/static/upgrade_module.ts @@ -10,7 +10,7 @@ import {Injector, NgModule, NgZone, Testability} from '@angular/core'; import * as angular from '../common/angular1'; import {$$TESTABILITY, $DELEGATE, $INJECTOR, $INTERVAL, $PROVIDE, INJECTOR_KEY, LAZY_MODULE_REF, UPGRADE_MODULE_NAME} from '../common/constants'; -import {controllerKey} from '../common/util'; +import {LazyModuleRef, controllerKey} from '../common/util'; import {angular1Providers, setTempInjectorRef} from './angular1_providers'; import {NgAdapterInjector} from './util'; @@ -166,7 +166,10 @@ export class UpgradeModule { .factory( LAZY_MODULE_REF, - [INJECTOR_KEY, (injector: Injector) => ({injector, needsNgZone: false})]) + [ + INJECTOR_KEY, + (injector: Injector) => ({ injector, needsNgZone: false } as LazyModuleRef) + ]) .config([ $PROVIDE, $INJECTOR,