ребята всем привет, подскажите как зарефакторить такой роут -
export const pagesRoute: Route[] = [
{
path: '', redirectTo: '/login', pathMatch: 'full'
},
{
path: '',
component: PagesComponent,
children: [
{
path: 'dashboard',
component: DashboardComponent,
data: {
breadcrumb: 'Dashboard',
allowRoles: [RolesEnum['Nav.Admin.access']]
},
canActivate: [RoleGuard]
},
{
path: 'customer-dashboard',
component: CustomerDashboardComponent,
data: {
breadcrumb: 'Customer Dashboard',
allowRoles: [
RolesEnum['Nav.SingleCustomer.access']
]
},
canActivate: [RoleGuard]
},
{
path: 'zones',
canActivate: [RoleGuard],
data: {
breadcrumb: 'Zones',
allowRoles: [
RolesEnum['Nav.ListZones.access']
]
},
children: [
{
path: '',
data: {
breadcrumb: ''
},
component: ZonesComponent
},
{
path: ':id/sensors',
data: {
breadcrumb: 'List of Sensors'
},
children: [
{path: '', data: {breadcrumb: ''}, component: SensorsComponent, pathMatch: 'full'},
{
path: 'create',
data: {
breadcrumb: 'Sensor Create'
},
resolve: {selectedSensor: SensorResolver},
component: CreateSensorComponent
},
{
path: ':id/edit',
data: {
breadcrumb: ':id/Sensor Edit'
},
component: EditSensorComponent
}
]
},
{
path: ':name/edit/:id',
component: EditZoneComponent,
resolve: {selectedZone: ZoneResolver},
data: {
breadcrumb: ':id/Edit Zone',
allowRoles: [
RolesEnum['Manage.ListZones.edit']
]
}
},
{
path: 'create',
component: CreateZoneComponent,
canActivate: [RoleGuard],
data: {
breadcrumb: 'Create Zone',
allowRoles: [
RolesEnum['Manage.ListZones.create']
]
}
}
]
},
{
path: 'sensor/:id',
component: SensorComponent,
canActivate: [RoleGuard],
data: {
allowRoles: [
RolesEnum['Nav.ConfigureSensor.access']
]
},
children: [
{
pathMatch: 'full',
path: '',
redirectTo: 'configuration'
},
{
path: 'configuration',
data: {
breadcrumb: 'Sensor Configuration'
},
children: [
{
pathMatch: 'full',
path: '',
data: {
breadcrumb: ''
},
component: SensorDetailsComponent
},
{
path: 'sensor-configuration-histories',
canActivate: [RoleGuard],
data: {
breadcrumb: 'Sensor Configuration Histories',
allowRoles: [
RolesEnum['Nav.ConfigureSensorHistory.access']
]
},
children: [
{
path: '',
data: {
title: 'basic',
breadcrumb: ''
},
pathMatch: 'full',
component: SensorConfigurationHistoriesComponent
},
{
path: ':id',
canActivate: [RoleGuard],
data: {