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[] = [
3333] ;
3434
3535export 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 33 "files" :[
44 " !**/*.d.ts" ,
55 " !**/*.js" ,
6- " !**/*.[1,2,3,4,5].*" ,
6+ " !**/*.[1,2,3,4,5,6 ].*" ,
77 " !app/crisis-list.component.ts" ,
88 " !app/hero-list.component.ts" ,
99 " !app/crisis-center/add-crisis.component.ts" ,
Original file line number Diff line number Diff line change @@ -1687,7 +1687,7 @@ figure.image-display
16871687 our child routes.
16881688
16891689+ makeTabs(
1690- ` router/ts/app/app.routing.ts,
1690+ ` router/ts/app/app.routing.6. ts,
16911691 router/ts/app/crisis-center/crisis-center.routing.ts` ,
16921692 'lazy-load-crisis-center,lazy-load-crisis-center' ,
16931693 ` app.routing.ts (load children),
@@ -1725,7 +1725,7 @@ figure.image-display
17251725 If our initial redirect went to `/heroes` instead of going to `/crisis-center`, the `CrisisCenterModule` would not be loaded until the user
17261726 visited a `Crisis Center` route. We'll update our redirect in our `app.routing.ts` to make this change.
17271727
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)' )
17291729
17301730<a id =" final-app" ></a >
17311731.l-main-section
You can’t perform that action at this time.
0 commit comments