⊗jsagPmRtRO 93 of 97 menu

Route Order in Angular

Angular processes routes from top to bottom. This means that special cases of routes should be placed first, and then more general ones.

In the following example, the first route will always work:

const appRoutes: Routes =[ { path: '**', component: NotFoundComponent }, { path: 'aaaa', component: AaaaComponent}, { path: 'bbbb', component: BbbbComponent}, ];

Change the order of the routes in the example to the correct one:

const appRoutes: Routes =[ { path: 'blog/:id', component: AaaaComponent}, { path: 'blog/new', component: BbbbComponent}, ];
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline