Angular 7 routerLink directive warning 'Navigation triggered outside Angular zone'

前端 未结 4 1115
既然无缘
既然无缘 2021-02-07 00:57

I am struggling with Angular framework to get my application run smoothly, but I can\'t resolve an issue with routing. I have a top level AppComponent and ap

4条回答
  •  甜味超标
    2021-02-07 01:23

    We had encountered this bug when we were navigating somewhere in our solution.

    In our sidebar component we use on-push change detection and we have had one this.ref.detectChanges() when routing occured (change of parameters), which somehow broke routing (possibly kicking parallel running resolvers out of ngZone or something similar). After changing this to the anyway preferred this.ref.markForCheck() this bug didn't appear again. I'm happy we didn't need a workaround, weird behavior though..

    Hope this helps anyone having the same issue.

提交回复
热议问题