July 2017
Intermediate to advanced
454 pages
10h 1m
English
Route Guards let you control various stages of a route navigation. While navigating from one component to another, we need to make sure that the data that will be displayed is authorized for the user, and if not, cancel the navigation.
A Router Guard can return an Observable<boolean> or a Promise<boolean>, and the router will wait for Observable to resolve to either true or false:
There are various Route Guards we can use either independently or in combinations. They are as follows:
The guard function can accept ...
Read now
Unlock full access