Angular 2: NavigationCancel - Navigation ID 2 is not equal to the current navigation id 3

后端 未结 4 1996
北荒
北荒 2020-12-16 10:50

I\'m trying to redirect old URLs (links in email templates) from a previous site to another route like this:

if (route.url.indexOf(\'/#/\') !== -1) {
    thi         


        
4条回答
  •  北海茫月
    2020-12-16 11:23

    I had the exact same problem, but found another cause to explain it.

    This was because of a HTML attribute href="#" on my anchor link where I had my onClick method calling the router.navigate().

    Detailed answer here:

    https://stackoverflow.com/a/61595269/3992814

提交回复
热议问题