angular / router

The Angular 1 Component Router
MIT License
665 stars 135 forks source link

path match prefix not working anymore? #427

Closed anasAsh closed 7 years ago

anasAsh commented 7 years ago

Hello everyone, From what I understand from Angular2 router documentation, the routes config default pathMatch strategy is "prefix", "prefix" pathMatch strategy means the the app router only needs to look on the start of the url and match it with the proper route.

Reference: https://angular.io/docs/js/latest/api/router/index/Routes-type-alias.html#!#matching-strategy

That been said, with the below configurations I would assume that this route should load ExampleComponent if I navigate to /abcdefg.

One problem that this is not working, am not sure what is wrong and i cant find much information about this on google or in @angular/router source code.

Thank you for your help.

    const ROUTES: Routes = [
      { path: '', component: MainLayoutComponent, pathMatch: 'prefix', canActivate: [AuthGuard], children: [
        { path:'abc', pathMatch: 'prefix', component: ExampleComponent},
        { path: '', component: HomepageComponent }
      ]},
     ];

     export const ROUTING = RouterModule.forRoot(ROUTES, { useHash: false });
anasAsh commented 7 years ago

sorry this was meant for angular 2 router.