gmostert / ng2-breadcrumb

This is an angular 2 component that creates a breadcrumb trail. It hooks into the angular2/router, to dynamically build up the crumb trail once a component is routed to.
MIT License
102 stars 81 forks source link

canActivate in guards returns the target route even if it returns false #62

Open jiann4321 opened 7 years ago

jiann4321 commented 7 years ago

Breadcrumb showing the target route even if the route guard returns false.

canActivate() {
    if (!_.isEmpty(user.account) && !_.isEmpty(user.role)) {
      return true
    }
    else {
      this.router.navigate(['/switch-account'])
      return false
    }
  }