1
Reply

Can Route have multiple CanActivate guard?

Manoj Kalla

Manoj Kalla

Jun 05
498
0
Reply

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:

    1. const routes: Routes = [
    2. {
    3. path: 'secure',
    4. component: SecureComponent,
    5. canActivate: [AuthGuard, RoleGuard, PermissionGuard]
    6. }
    7. ];