Skip to content

Commit

Permalink
fix(lazyLoad): fixed getting parent injector in angular 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
aitboudad authored and christopherthielen committed Jun 12, 2017
1 parent 543afcd commit dcd1cda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lazyLoad/lazyLoadNgModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export function loadModuleFactory(moduleToLoad: NgModuleToLoad, ng2Injector: Inj
*/
export function applyNgModule(transition: Transition, ng2Module: NgModuleRef<any>): LazyLoadResult {
let injector = ng2Module.injector;
let parentInjector = <Injector> ng2Module.injector['parent'];
let parentInjector = <Injector> ng2Module.injector['parent'] || ng2Module.injector['_parent'];
let uiRouter: UIRouter = injector.get(UIRouter);
let registry = uiRouter.stateRegistry;

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

3 comments on commit dcd1cda

@bopm
Copy link

@bopm bopm commented on dcd1cda Jun 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So ui-router is broken for angular 4.2 without this, but no one actually cares about that much to push new npm release. 👎

@christopherthielen
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you silly? I'm still gonna send it

@bopm
Copy link

@bopm bopm commented on dcd1cda Jun 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. I just upgraded to 4.2, and now I see that I need to rollback because of no way for me to apply that patch in my automated docker workflow. Seeing that fix is actually works and one thing that holds me back is npm release of let's say beta7 makes me feel really strange.

Please sign in to comment.