---
source: https://iinventedlight.com/library/notes/angular-route-guards.md
title: "Angular route guards decide whether navigation to a route may proceed"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC BY 4.0 (Angular docs, footer-verified); MIT (angular/angular source); prose restates cited source lines in own words"
license_family: angular-docs-ccby
attribution: "Summary by iinventedlight (AI-assisted). Sources: Angular docs, CC BY 4.0 text (angular/angular adev footer); Angular source, MIT (angular/angular). Notices: Angular documentation (angular/angular adev): Copyright (c) 2010-2026 Google LLC; CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Angular source (angular/angular): Copyright (c) 2010-2026 Google LLC; MIT (https://raw.githubusercontent.com/angular/angular/main/LICENSE)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-11
status: published
approved_by: "Cole Withington, 2026-11-11 09:59 PT, Librarian chat widget t34s5: \"Yes, publish all 25 Angular and Vite drafts\""
checked_on: 2026-11-11
as_of: 2026-11-11
confidence: medium
untested: "No project was run for this note; only the fetched documentation and source files were read."
category: coding-references
topic_area: "code-web: Angular route guards"
tags: [angular, routing, guards, canactivate]
client: Librarian
sources:
  - id: S1
    title: "Route guards"
    publisher: Angular docs
    url: https://angular.dev/guide/routing/route-guards
    accessed: 2026-11-11
    license: "CC BY 4.0"
  - id: S2
    title: "Functional guards"
    publisher: Angular source
    url: https://github.com/angular/angular/blob/main/packages/router/src/utils/functional_guards.ts
    accessed: 2026-11-11
    license: "MIT"
---
# Route guards control whether a user can enter or leave a route

**Answer:** Guards control whether a user can navigate to or leave a route. They act as checkpoints for access to specific routes. Common uses include authentication and access control.

Do not treat client-side guards as the only access control. JavaScript that runs in a browser can be modified by the person running the browser. Enforce authorization on the server as well.

## Return types

All route guards share the same possible return types. `boolean` allows navigation when true and blocks it when false (with a note for `CanMatch`). A `UrlTree` or `RedirectCommand` redirects to another route instead of blocking. A `Promise` or `Observable` is also allowed: the router uses the first emitted value and then unsubscribes. A guard must emit a value.

## In source

Helpers such as `mapToCanActivate` and `mapToCanMatch` map an array of injectable guard classes to equivalent functional guards (`CanActivateFn`, `CanMatchFn`) for use in a `Route` definition. `mapToResolve` maps an injectable class with a `resolve` method to a `ResolveFn`.

## See also

- [angular-routing](https://iinventedlight.com/library/notes/angular-routing/)
- [angular-ssr](https://iinventedlight.com/library/notes/angular-ssr/)

## Claims

- id: C1
  claim: Route guards control whether a user can navigate to or leave a route.
  source: S1
  evidence: "Route guards are functions that control whether a user can navigate"

- id: C2
  claim: true allows navigation and false blocks it.
  source: S1
  evidence: "`true` allows navigation, `false` blocks it"

- id: C3
  claim: mapToCanActivate maps injectable classes to CanActivateFn guards.
  source: S2
  evidence: "Maps an array of injectable classes with canActivate functions to an array of equivalent"

- id: C4
  claim: The mapped functions are for use in a Route definition.
  source: S2
  evidence: "`CanActivateFn` for use in a `Route` definition."

## Sources

- [S1] Route guards. Angular docs. https://angular.dev/guide/routing/route-guards . License: CC BY 4.0. Accessed 2026-11-11.

- [S2] Functional guards. Angular source. https://github.com/angular/angular/blob/main/packages/router/src/utils/functional_guards.ts . License: MIT. Accessed 2026-11-11.


License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources and notices: Angular documentation (angular/angular adev): Copyright (c) 2010-2026 Google LLC; CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Angular source (angular/angular): Copyright (c) 2010-2026 Google LLC; MIT (https://raw.githubusercontent.com/angular/angular/main/LICENSE). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
