In Angular can we attached multile CanActivate guard on one route.
Yes, in Angular, you can attach multiple CanActivate guards to a single route. This feature allows you to implement complex authorization logic by chaining multiple guards together. Each guard in the chain must return true for the navigation to proceed. Here’s an example of how you can attach multiple guards to a route:
const routes: Routes = [ { path: 'secure', component: SecureComponent, canActivate: [AuthGuard, RoleGuard, PermissionGuard] }];
const routes: Routes = [
{
path: 'secure',
component: SecureComponent,
canActivate: [AuthGuard, RoleGuard, PermissionGuard]
}
];