Is there a way to optimize this code from this
{ path: \'access-requests\', canActivate: [AccessGuard], component: AccessRequestsComponent, children:
You can use a mapped array:
children: [ // excluding the other paths for brevity ...['today', 'tomorrow', 'expired'].map(path => ({ path, component: AccessRequestsComponent })) ]