Angular හි මාර්ග අනුපිළිවෙල

Angular ඉහළ සිට පහළට මාර්ග සකසයි. මෙයින් අදහස් කරන්නේ මුලින්ම සුවිශේෂී මාර්ග අවස්ථා තැබිය යුතු අතර පසුව වඩාත් සාමාන්‍ය ඒවා තැබිය යුතු බවයි.

පහත උදාහරණයේ සෑම විටම පළමු මාර්ගය ක්‍රියාත්මක වේ:

app/app.component.tsconst appRoutes: Routes =[
  { path: '**', component: NotFoundComponent },
  { path: 'aaaa', component: AaaaComponent},
  { path: 'bbbb', component: BbbbComponent},
];
Задание 1

නිවැරදි අනුපිළිවෙලට උදාහරණයේ මාර්ග අනුපිළිවෙල වෙනස් කරන්න:

app/app.component.tsconst appRoutes: Routes =[
  { path: 'blog/:id', component: AaaaComponent},
  { path: 'blog/new', component: BbbbComponent},
];