I have routings like this in my main module routing.
const routes: Routes = [
{
path: '',
redirectTo: 'home',
pathMatch: 'full',
},
{
path: 'home',
component: MainComponent,
children: [
{
path: '',
loadChildren: () => import('../HR/human-resources.module').then(m => m.HumanResourcesModule),
}
]
}];
and in the human-resources-routing.module.ts I have routings like this.
const routes: Routes = [
{
path: '',
children: [
{
path: '',
component: QuestionGroupComponent
},
{
path: 'reports',
component: DatePeriodComponent
},
{
path: 'states',
component: StateWithTopPersonnelComponent
},
{
path: 'personnel',
component: StatePersonnelComponent
},
{
path: 'personnel-detail',
component: PersonnelDetailComponent
}
]
}];
For example now when I want to go to DatePeriodComponent I have a URL like this http://localhost:4200/home/reports but something which I want to show is a bit different. I want to show the URL like this http://localhost:4200/reports without home for all of my routs. How can I omit that or prevent to show in the URL?