NG.V · Angular 22 practice question

A route requires both an authentication check and a role permission check before activation. How are multiple guards configured on a single route definition?

Choose one answer
Check answer and explanation

Correct answer: Specify the guards in an array on the route's guard property

Explanation

Route configurations accept guards as arrays so you can attach multiple guards to the same route.

Common trap

Angular route guard properties expect function references in an array, not string expressions separated by pipes. JavaScript object literals cannot have duplicate keys of the same name without overwriting the earlier property.

Source: Angular docs: Control route access with guards — Applying guards to routes
Checked against the cited text on 2026-11-25.

Report an error in this question