Problem Statement
Explain how Angular Router changes views without reloading the page.
Explanation
The Router listens to URL changes and renders the matched component inside `<router-outlet>`. You declare `Routes` that map paths to components, and use `routerLink` for navigation. State persists in memory, so the experience feels like a native app.
Code Solution
SolutionRead Only
const routes: Routes = [ { path: 'dashboard', component: DashboardComponent } ];
@NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] }) export class AppRoutingModule {}