-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.routing.ts
40 lines (33 loc) · 976 Bytes
/
app.routing.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
// #docregion
// #docregion import-router
import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
// #enddocregion import-router
import { loginRoutes,
authProviders } from './login.routing';
import { CanDeactivateGuard } from './can-deactivate-guard.service';
export function loadCrisisCenter() {
return require('es6-promise!./crisis-center/crisis-center.module')('CrisisCenterModule');
}
// #docregion lazy-load-crisis-center
export const crisisCenterRoutes: Routes = [
{
path: '',
redirectTo: '/heroes',
pathMatch: 'full'
},
{
path: 'crisis-center',
loadChildren: loadCrisisCenter
}
];
export const appRoutes: Routes = [
...loginRoutes,
...crisisCenterRoutes
];
// #enddocregion lazy-load-crisis-center
export const appRoutingProviders: any[] = [
authProviders,
CanDeactivateGuard
];
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);