How does RouterLink differ from a regular <a href>?
The difference between RouterLink and a regular <a href=""> is in the navigation mechanics:
<a href="">
- Refreshes the whole document - a full page reload.
- The request goes to the server, even if the page already exists in the application.
- Works independently of Angular.
[routerLink]
- Uses the Angular Router - navigation without a reload.
- Only part of the page is updated (through
<router-outlet>). - Faster, controlled, and you can add parameters, guards, lazy loading, and so on.
Roughly speaking:
href means "leave and reload",
routerLink means "stay and just show something else".
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.