/
farms-routing.module.ts
50 lines (48 loc) · 1.42 KB
/
farms-routing.module.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { FarmsAndSeasonsGuard } from './farms-and-seasons.guard';
import { FarmsAndSeasonsResolver } from './farms-and-seasons.resolver';
import { FarmsComponent } from './farms.component';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [
{
path: 'empty',
loadChildren: () => import('./empty/empty.module').then(m => m.EmptyModule),
},
{
path: ':farmId/:seasonId/:animalType/details',
component: FarmsComponent,
loadChildren: () => import('./details/details.module').then(m => m.DetailsModule),
resolve: {
farmsAndSeasons: FarmsAndSeasonsResolver
}
},
{
path: ':farmId/:seasonId/dashboard',
component: FarmsComponent,
loadChildren: () => import('./dashboard/dashboard.module').then(m => m.DashboardModule),
resolve: {
farmsAndSeasons: FarmsAndSeasonsResolver
}
},
{
path: ':farmId/:seasonId',
canActivate: [ FarmsAndSeasonsGuard ],
component: FarmsComponent
},
{
path: ':farmId',
canActivate: [ FarmsAndSeasonsGuard ],
children: []
},
{
path: '',
canActivate: [ FarmsAndSeasonsGuard ],
children: []
}
];
@NgModule({
imports: [ RouterModule.forChild(routes) ],
exports: [ RouterModule ]
})
export class FarmsRoutingModule {
}