Skip to content
masterclass Buddy

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.

Subscribe
  • CanActivate
  • CanActivateChild
  • CanDeactivate
  • CanMatch
  • UrlTree
  • RedirectCommand
  • ActivatedRouteSnapshot
  • RouterStateSnapshot

Source: Control route access with guards • Angular. Checked 2026-11-03.