I am trying to redirect old URLs (links in email templates) from a previous site to another route as follows:
if (route.url.indexOf('/#/') !== -1) { this.router.navigate(['/my-route']); }
However, navigation is canceled for the following reason:
Navigation ID 2 is not equal to the current navigation id 3 .
Looking at the source of the Angular 2 router, this happens in the runNavigate method when id !== this.navigationId ( https://github.com/angular/angular/blob/master/modules/@angular/router/src/router.ts # L652 ). I can not find information about the navigationId property, why this is happening and how to solve it.
Forwarding between existing routes seems to work, but not between these old hash characters and existing routes. Do both routes have to exist in the router in order to be able to redirect between them?
Help would be greatly appreciated.
source share