A route guard is a feature that controls access to specific routes in the Angular application. It can protect routes from unauthorized access, require certain conditions be met before navigating to a route or perform other checks and actions during the navigation process.
Angular provides five types of route guards:
- CanActivate
- CanActivateChild
- CanDeactivate
- CanLoad
- Resolve
Most of the time, you use either CanActivate or CanActivateChild. The CanActivate guard determines whether a route can be activated, and the CanActivateChild determines whether a child route can be activated.
In this post, we will learn to create and apply a CanActivate route guard to the routes.
Read full articles here :
https://www.telerik.com/blogs/5-steps-route-guards-angular
Thanks for reading.
Discover more from Dhananjay Kumar
Subscribe to get the latest posts sent to your email.