tezvyn:

RouterLink: Client-Side Navigation in Angular

Source: angular.devbeginner

RouterLink is Angular's replacement for `<a>` tags, preventing full page reloads in a Single-Page App. Use it on any element to navigate between views. The common footgun is using a standard `<a href="...">`, which reloads the page and loses application state.

RouterLink is an Angular directive that replaces the standard `<a>` tag, enabling client-side navigation without the full page reloads that break a Single-Page App. It integrates with the Angular Router to swap components in a `<router-outlet>` instead of fetching a new page. The primary footgun is using a plain `<a href="...">` out of habit, which triggers a browser refresh and destroys your application's current state.

Read the original → angular.dev

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

RouterLink: Client-Side Navigation in Angular · Tezvyn