Angular · Concept
Route guards
Angular route guards control whether navigation can enter or leave a route. They can allow navigation, block it, redirect it, or return an asynchronous result.
Last updated
Syntax
ng generate guard CUSTOM_NAME
{ path: 'dashboard', component: Dashboard, canActivate: [authGuard] }In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
CanActivateCanActivateChildCanDeactivateCanMatchUrlTreeRedirectCommandActivatedRouteSnapshotRouterStateSnapshot