1

Is there a way to implement CanActivate guard in Angular 4 such that if any one guard is true the route should be allowed. I know this is possible by using provide to a function and implementing the logic inside it, but was having a tough time injecting dependencies in that function inside app routing module class. I have written a Custom class that handles the Authentication and Authorization related functions. This custom class is injectable and used for role verification.

Please recommend if there is a framework level facility to implement this as the default functionality allows access to a route if all guards are true.

mxr7350
  • 1,438
  • 3
  • 21
  • 29

1 Answers1

-1

I ended up creating a guard for each component and injecting them in the app.module.