Angular හි මාර්ග අනුපිළිවෙල
Angular ඉහළ සිට පහළට මාර්ග සකසයි. මෙයින් අදහස් කරන්නේ මුලින්ම සුවිශේෂී මාර්ග අවස්ථා තැබිය යුතු අතර පසුව වඩාත් සාමාන්ය ඒවා තැබිය යුතු බවයි.
පහත උදාහරණයේ සෑම විටම පළමු මාර්ගය ක්රියාත්මක වේ:
const appRoutes: Routes =[
{ path: '**', component: NotFoundComponent },
{ path: 'aaaa', component: AaaaComponent},
{ path: 'bbbb', component: BbbbComponent},
];
නිවැරදි අනුපිළිවෙලට උදාහරණයේ මාර්ග අනුපිළිවෙල වෙනස් කරන්න:
const appRoutes: Routes =[
{ path: 'blog/:id', component: AaaaComponent},
{ path: 'blog/new', component: BbbbComponent},
];