This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +49
-13
lines changed Expand file tree Collapse file tree 4 files changed +49
-13
lines changed Original file line number Diff line number Diff line change
1
+ // #docregion
2
+ // #docregion import-router
3
+ import { Routes , RouterModule } from '@angular/router' ;
4
+ // #enddocregion import-router
5
+
6
+ import { loginRoutes ,
7
+ authProviders } from './login.routing' ;
8
+
9
+ import { CanDeactivateGuard } from './can-deactivate-guard.service' ;
10
+
11
+ // #docregion lazy-load-crisis-center
12
+ const crisisCenterRoutes : Routes = [
13
+ {
14
+ path : '' ,
15
+ redirectTo : '/crisis-center' ,
16
+ pathMatch : 'full'
17
+ } ,
18
+ {
19
+ path : 'crisis-center' ,
20
+ loadChildren : 'app/crisis-center/crisis-center.module#CrisisCenterModule'
21
+ }
22
+ ] ;
23
+
24
+ const appRoutes : Routes = [
25
+ ...loginRoutes ,
26
+ ...crisisCenterRoutes
27
+ ] ;
28
+ // #enddocregion lazy-load-crisis-center
29
+
30
+ export const appRoutingProviders : any [ ] = [
31
+ authProviders ,
32
+ CanDeactivateGuard
33
+ ] ;
34
+
35
+ export const routing = RouterModule . forRoot ( appRoutes ) ;
36
+ // #enddocregion
37
+
38
+ /* A link parameters array
39
+ // #docregion heroes-redirect
40
+ {
41
+ path: '',
42
+ redirectTo: '/heroes',
43
+ pathMatch: 'full'
44
+ },
45
+ // #enddocregion heroes-redirect
46
+ */
Original file line number Diff line number Diff line change @@ -33,13 +33,3 @@ export const appRoutingProviders: any[] = [
33
33
] ;
34
34
35
35
export const routing = RouterModule . forRoot ( appRoutes ) ;
36
-
37
- /* A link parameters array
38
- // #docregion heroes-redirect
39
- {
40
- path: '',
41
- redirectTo: '/heroes',
42
- pathMatch: 'full'
43
- },
44
- // #enddocregion heroes-redirect
45
- */
Original file line number Diff line number Diff line change 3
3
"files" :[
4
4
" !**/*.d.ts" ,
5
5
" !**/*.js" ,
6
- " !**/*.[1,2,3,4,5].*" ,
6
+ " !**/*.[1,2,3,4,5,6 ].*" ,
7
7
" !app/crisis-list.component.ts" ,
8
8
" !app/hero-list.component.ts" ,
9
9
" !app/crisis-center/add-crisis.component.ts" ,
Original file line number Diff line number Diff line change @@ -1687,7 +1687,7 @@ figure.image-display
1687
1687
our child routes.
1688
1688
1689
1689
+ makeTabs(
1690
- ` router/ts/app/app.routing.ts,
1690
+ ` router/ts/app/app.routing.6. ts,
1691
1691
router/ts/app/crisis-center/crisis-center.routing.ts` ,
1692
1692
'lazy-load-crisis-center,lazy-load-crisis-center' ,
1693
1693
` app.routing.ts (load children),
@@ -1725,7 +1725,7 @@ figure.image-display
1725
1725
If our initial redirect went to `/heroes` instead of going to `/crisis-center`, the `CrisisCenterModule` would not be loaded until the user
1726
1726
visited a `Crisis Center` route. We'll update our redirect in our `app.routing.ts` to make this change.
1727
1727
1728
- + makeExample('router/ts/app/app.routing.ts' , 'heroes-redirect' , 'app.routing.ts (heroes redirect)' )
1728
+ + makeExample('router/ts/app/app.routing.6. ts' , 'heroes-redirect' , 'app.routing.ts (heroes redirect)' )
1729
1729
1730
1730
<a id =" final-app" ></a >
1731
1731
.l-main-section
You can’t perform that action at this time.
0 commit comments