Click to watch Angular Playlist: • Angular
To view the code of this tutorial. Please visit this Github link: https://github.com/lets-build-with-co...
Note : Switch the particular branch of the tutorials of Github
To download my git repo of JSON Server & use it in you local for practice, Please visit this link: https://github.com/lets-build-with-co...
Guards in Angular
Angular, guards are used to control access to routes and protect certain parts of your application. They allow you to implement authentication, authorization, and other security checks.
There are several types of guards available in Angular.
i.) CanActivate
ii.) CanActivateChild
iii.) CanDeactivate
iv.) CanLoad
v.) Resolve
vi.) CanMatch
In this tutorial we created Can Match Guard
canMatch is a guard that can be used to determine if the current user is allowed to match the route.
canMatch is an array of CanMatchFn or DI tokens used to look up CanMatch() handlers.
It is effectively a replacement for canLoad and canActivate.