1. How do you configure routes and render them in a template?
Define an array of Routes and pass it to RouterModule.forRoot/forChild. Use <router-outlet> where routed components should appear and routerLink for in-app navigation.
const routes: Routes = [
{ path: '', component: HomeComponent },
{ path: 'about', component: AboutComponent }
];
@NgModule({ imports: [RouterModule.forRoot(routes)], exports: [RouterModule] })
export class AppRoutingModule {}
<!-- template -->
<a routerLink="/about">About</a>
<router-outlet></router-outlet>