I need help auto-redirecting to a child route when initializing a module.
For example, if the current path is my-app/masterview
, I want to automatically redirect to my-app/masterview/overview
.
My attempted solution is not working as expected. The path remains as my-app/masterview
.
app.routing.module.ts
const routes: Routes = [{
path: '',
component: MasterComponent,
redirectTo: 'overview',
children: [{
path: 'overview',
component: OverviewComponent
},
{
path: 'details/:id',
component: DetailsComponent
}
]
}];
Can someone point out what I am doing incorrectly?