In this video we will discuss implementing CanActivate guard in Angular with an example.
As the name implies CanActivate guard determines if a route can be activated. There are several use cases for CanActivate guard.
1. We can use it to check if the user is authenticated before allowing him to access protected areas of the application. If he is not authenticated, we redirect him to AccessDenied component or Login component.
2. Similarly we can use it to check, if a specific resource he is looking for exists. if the resource does not exist we redirect him to the PageNotFound component. If the resource exists, we redirect the user to navigate the resource.
Text version of the video
Angular CRUD Tutorial
Angular CRUD Tutorial Text Articles & Slides
All Dot Net and SQL Server Tutorials in English
All Dot Net and SQL Server Tutorials in Arabic