On click, redirect to a route for which canActive returned false once

114 Views Asked by At

I have a guard on a route with 3 children. I land in a ZeroStateComponent when I do not have data. In the ZeroStateComponent, I have a Get started button which is supposed to land me to the Admin route again. Nothing is happening when I click on Get Started. nopermissions is still accessible but somehow adminroute is not loading. Is it because canActivate has already returned false once?

  { path: "nopermissions", component: NoPermissionsComponent },
  { path: "nodata", component: ZeroStateComponent }, {
  path: "", canActivate: [FeatureFlagGuardService], canActivateChild: [AdminDataGuardService],
  children: [
    { path: "", redirectTo: "admin", pathMatch: "full" },
    { path: "admin", loadChildren: "../modules/admin.module#AdminModule" },
    { path: "**", redirectTo: "admin" }
  ]
}
]


0

There are 0 best solutions below