Use redirectTo if you using also children parameter, is this possible? Use redirectTo if you using also children parameter, is this possible? typescript typescript

Use redirectTo if you using also children parameter, is this possible?


An empty child route should do the job:

  {    path: 'project/:id',    component: ProjectComponent,    children: [      {        path: '',        redirectTo: 'properties',        pathMatch: 'full'      },      {        path: 'properties',        component: ProjectPropertiesComponent,      },      {        path: 'stats',        component: ProjectStatsComponent      }    ]  }


j2L4e answer is correct, but I was also forced to set the 'pathMatch' type as 'prefix' ..

pathMatch: 'prefix'

  {    path: 'project/:id',    component: ProjectComponent,    children: [      {        path: '',        redirectTo: 'properties',        pathMatch: 'prefix'      },      {        path: 'properties',        component: ProjectPropertiesComponent,      },      {        path: 'stats',        component: ProjectStatsComponent      }    ]  }