The 5 Steps to Route Guards in Angular

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:

  1. CanActivate
  2. CanActivateChild
  3. CanDeactivate
  4. CanLoad
  5. 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.

Published by Dhananjay Kumar

Dhananjay Kumar is founder of NomadCoder and ng-India

Leave a comment

Discover more from Dhananjay Kumar

Subscribe now to keep reading and get access to the full archive.

Continue reading