NG.V · Angular 22 practice question
A developer is comparing '<a href="https://www.angular.dev/essentials">' with a relative navigation path in an Angular app. What distinguishes an absolute URL from a relative URL?
<a href="https://www.angular.dev/essentials">Angular Essentials Guide</a>
<a href="/essentials">Angular Essentials Guide</a>
Check answer and explanation
Correct answer: An absolute URL includes the full path with the protocol and root domain, whereas a relative URL is resolved relative to the current route's location
Explanation
Absolute URLs specify the full address including the protocol and root domain, while relative URLs define navigation paths relative to the current route's location.
Common trap
External absolute URLs with protocols use standard href attributes rather than routerLink. This reverses the two definitions: the protocol and root domain belong to absolute URLs, not relative ones.
Source: Angular docs: Navigate to routes — Using absolute or relative links
Checked against the cited text on 2026-11-25.