From 4586fccae449a8e20c5555e82683ea7419fb7e8a Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Wed, 13 Sep 2017 15:54:52 +0300 Subject: [PATCH] refactor(upgrade): use correct property name (#19180) It doesn't make any difference in this case, because the we only check the property for truthfulness (and being undefined has the same effect as being set to false). PR Close #19180 --- packages/upgrade/src/dynamic/upgrade_adapter.ts | 7 +++++-- packages/upgrade/src/static/upgrade_module.ts | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) 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,