Child Routes များသည် nested routing structure တစ်ခု တည်ဆောက်ရန် အသုံးပြုသည်။
typescript
// app-routing.module.ts
const routes: Routes = [
{
path: 'dashboard',
component: DashboardComponent,
children: [
{ path: '', redirectTo: 'overview', pathMatch: 'full' },
{ path: 'overview', component: OverviewComponent },
{ path: 'stats', component: StatsComponent },
{ path: 'settings', component: SettingsComponent }
]
}
];
// dashboard.component.html
<div class="dashboard">
<nav>
<a routerLink="overview">Overview</a>
<a routerLink="stats">Statistics</a>
<a routerLink="settings">Settings</a>
</nav>
<!-- Child routes render here -->
<router-outlet></router-outlet>
</div>You should see
(/dashboard/overview, /dashboard/stats စသည်ဖြင့် nested routes များ အလုပ်လုပ်မည်)