Dans le fichier app-routing.module.ts, on rajoute nos routes dans le tableau Routes = [];
Attention à l'ordre de déclaration de nos routes !
Penser a rajouter dans le app.component.html la balise : <router-outlet>
const routes: Routes = [
//path : chemin dans l'URL, composant a afficher
{ path: 'home', component: HomeComponent },
{ path: 'admin/dashboard', component: AdminDashboardComponent}
];
<router-outlet></router-outlet>
Pour optimiser Angular application voir OPTIMIZE ANGULAR APPS ⇒ lazy loading