In Angular, Guard is used to protecting the Routes. Route guards can also control whether a user can leave a certain route. For example, say the user has typed information into a form on the page, but has not submitted the form. If they were to leave the page, they would lose the information. We may want to prompt the user if the user attempts to leave the route without submitting or saving the information.
Guard Types
There are four different guard types we can use to protect our routes:
CanActivate - Decides if a route can be activated
CanActivateChild - Decides if children routes of a route can be activated
CanDeactivate - Decides if a route can be deactivated
CanLoad - Decides if a module can be loaded lazily