Route without parameter value; Angular route redirect - Can I use redirectTo to parameter path?
I'm wandering if it is possible to redirect path: ' ' to path: ':id' ? Is there a way I can achieve this? Thank you. { path: 'folder', children: [ { path: '', redirectTo: ':id', pathMatch: 'full', }, { path: ':id', canActivate: [AuthGuard], component: DocumentsComponent, }, ] } I found a way to redirect 'folder' route to 'folder/:id' with empty 'id' parameter: { path: 'folder', redirectTo: 'folder/', pathMatch: 'full', }, { path: 'folder', children: [ { path: ':id', canActivate: [AuthGuard], component: DocumentsComponent, }, ] } *Note that the redirect must be first. if you give a default id