Problem Statement
What is the Angular Router and how does navigation work in an SPA?
Explanation
The Router maps URLs to components without reloading the page. Define routes in a `Routes` array and render them with `<router-outlet>`. Use `routerLink` for declarative links or `Router.navigate()` in code. This creates fast, app-like navigation.
Code Solution
SolutionRead Only
const routes: Routes = [ { path: 'home', component: HomeComponent } ];
// template
<a routerLink="/home">Home</a>
<router-outlet></router-outlet>