我有这样的路线:
[
{
path: ':orgName',
children: [
{
path: '',
component: HomeComponent
canActivate: [AuthGuard],
},
{
path: 'details',
component: DetailComponent
}
]
}
]
如何在 AuthGuard 的 canActivate 中访问 orgName?
我试过了
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
console.log(route.params["orgName"])
}
但它打印未定义