Angular
Diving Into Angular's Router

Simple Route Guards

Mute
Current Time 0:00
/
Duration Time 0:00
Loaded: 0%
Progress: 0%
Stream TypeLIVE
Remaining Time -0:00
 
PRO

There are a lot of cases where we'll want to prevent a user from accessing a certain route unless some condition is fulfilled. When it comes to authentication, that condition is commonly seen whether or not the user is logged in. We can use Angular's CanActivate route guard to prevent users from accessing a certain route unless they are authenticated.

 

I finished! On to the next tutorial