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
For me, this error was because of a part of the code running outside the NgZone. After which we had a this.ref.detectChanges()
running to detect changes. The changes detected would change the DOM and put . This use to break the routing.
Solution : We ran the part of code outside NgZone inside NgZone but using
this.ngZone.run
. This way we did not have to use ref.detectChanged()
as the changed(RxJS Subject subscribe) were in NgZone. This solved the routing issue.
Hope this helps anyone having the same issue.