Skip to content

Commit dcd1cda

Browse files
aitboudadchristopherthielen
authored andcommitted
fix(lazyLoad): fixed getting parent injector in angular 4.2
1 parent 543afcd commit dcd1cda

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lazyLoad/lazyLoadNgModule.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export function loadModuleFactory(moduleToLoad: NgModuleToLoad, ng2Injector: Inj
133133
*/
134134
export function applyNgModule(transition: Transition, ng2Module: NgModuleRef<any>): LazyLoadResult {
135135
let injector = ng2Module.injector;
136-
let parentInjector = <Injector> ng2Module.injector['parent'];
136+
let parentInjector = <Injector> ng2Module.injector['parent'] || ng2Module.injector['_parent'];
137137
let uiRouter: UIRouter = injector.get(UIRouter);
138138
let registry = uiRouter.stateRegistry;
139139

@@ -193,4 +193,4 @@ export function multiProviderParentChildDelta(parent: Injector, child: Injector,
193193
let childVals: RootModule[] = child.get(token, []);
194194
let parentVals: RootModule[] = parent.get(token, []);
195195
return childVals.filter(val => parentVals.indexOf(val) === -1);
196-
}
196+
}

0 commit comments

Comments
 (0)