Angular 2 CanActivate is called twice

前端 未结 3 1300
南方客
南方客 2021-02-20 09:20

I am faced with a problem with route guards with Angular.

My CanActivate guard is called twice when navigating to a page that is not permitted because I\'m not logged in

3条回答
  •  爱一瞬间的悲伤
    2021-02-20 10:05

    Although this is not a solution, it is an answer:

    This happens when using hash routing (useHash: true).

    It may be a bug in the Angular router.

    I am still investigating to see if there is a solution.

    Steve

提交回复
热议问题