NG.V · Angular 22 practice question
A route configuration places a general wildcard or parameterized route above a more specific static route, causing the static route to never activate. Why does route order matter in Angular?
Check answer and explanation
Correct answer: Angular uses a first-match wins strategy and stops checking once a route path matches
Explanation
Angular uses a first-match wins strategy and stops checking further routes as soon as one matches, so more specific routes must be declared before less specific ones.
Common trap
A last-match wins rule would make the bottom route win, which is the opposite of how Angular's router evaluates route arrays. The router preserves the exact array order you define rather than sorting routes alphabetically.
Source: Angular docs: Define routes — How Angular matches URLs
Checked against the cited text on 2026-11-25.