Is there a way to optimize this code from this
{
path: 'access-requests',
canActivate: [AccessGuard],
component: AccessRequestsComponent,
children: [
{
path: '',
redirectTo: 'today',
pathMatch: 'full'
},
{
path: 'today',
component: AccessRequestsComponent
},
{
path: 'tomorrow',
component: AccessRequestsComponent
},
{
path: 'expired',
component: AccessRequestsComponent
}
]
}
to something like this
{
path: 'access-requests',
canActivate: [AccessGuard],
component: AccessRequestsComponent,
children: [
{
path: '',
redirectTo: 'today',
pathMatch: 'full'
},
{
path: 'today | tomorrow | expired',
component: AccessRequestsComponent
}
]
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…