March 2017
Intermediate to advanced
118 pages
2h 1m
English

The router uses guards to make sure that navigation is permitted, which can be useful for security, authorization, and monitoring purposes.
There are four types of guards:
canLoad
,
canActivate
,
canActivateChild
, and
canDeactivate
. In this chapter we will look at each of them in detail.
Sometimes, for security reasons, we do not want the user to be able to even see the source code of the lazily loaded bundle if she does not have the right permissions. That's what the
canLoad
guard is for. If a canLoad
guard returns false, the router will not load the bundle. Let's take this configuration from the previous chapter ...
Read now
Unlock full access