parent
162b1773be
commit
420b9ca59e
|
@ -0,0 +1,46 @@
|
||||||
|
// #docregion
|
||||||
|
// #docregion import-router
|
||||||
|
import { Routes, RouterModule } from '@angular/router';
|
||||||
|
// #enddocregion import-router
|
||||||
|
|
||||||
|
import { loginRoutes,
|
||||||
|
authProviders } from './login.routing';
|
||||||
|
|
||||||
|
import { CanDeactivateGuard } from './can-deactivate-guard.service';
|
||||||
|
|
||||||
|
// #docregion lazy-load-crisis-center
|
||||||
|
const crisisCenterRoutes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
redirectTo: '/crisis-center',
|
||||||
|
pathMatch: 'full'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'crisis-center',
|
||||||
|
loadChildren: 'app/crisis-center/crisis-center.module#CrisisCenterModule'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const appRoutes: Routes = [
|
||||||
|
...loginRoutes,
|
||||||
|
...crisisCenterRoutes
|
||||||
|
];
|
||||||
|
// #enddocregion lazy-load-crisis-center
|
||||||
|
|
||||||
|
export const appRoutingProviders: any[] = [
|
||||||
|
authProviders,
|
||||||
|
CanDeactivateGuard
|
||||||
|
];
|
||||||
|
|
||||||
|
export const routing = RouterModule.forRoot(appRoutes);
|
||||||
|
// #enddocregion
|
||||||
|
|
||||||
|
/* A link parameters array
|
||||||
|
// #docregion heroes-redirect
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
redirectTo: '/heroes',
|
||||||
|
pathMatch: 'full'
|
||||||
|
},
|
||||||
|
// #enddocregion heroes-redirect
|
||||||
|
*/
|
|
@ -33,13 +33,3 @@ export const appRoutingProviders: any[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
export const routing = RouterModule.forRoot(appRoutes);
|
export const routing = RouterModule.forRoot(appRoutes);
|
||||||
|
|
||||||
/* A link parameters array
|
|
||||||
// #docregion heroes-redirect
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
redirectTo: '/heroes',
|
|
||||||
pathMatch: 'full'
|
|
||||||
},
|
|
||||||
// #enddocregion heroes-redirect
|
|
||||||
*/
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"files":[
|
"files":[
|
||||||
"!**/*.d.ts",
|
"!**/*.d.ts",
|
||||||
"!**/*.js",
|
"!**/*.js",
|
||||||
"!**/*.[1,2,3,4,5].*",
|
"!**/*.[1,2,3,4,5,6].*",
|
||||||
"!app/crisis-list.component.ts",
|
"!app/crisis-list.component.ts",
|
||||||
"!app/hero-list.component.ts",
|
"!app/hero-list.component.ts",
|
||||||
"!app/crisis-center/add-crisis.component.ts",
|
"!app/crisis-center/add-crisis.component.ts",
|
||||||
|
|
|
@ -1687,7 +1687,7 @@ figure.image-display
|
||||||
our child routes.
|
our child routes.
|
||||||
|
|
||||||
+makeTabs(
|
+makeTabs(
|
||||||
`router/ts/app/app.routing.ts,
|
`router/ts/app/app.routing.6.ts,
|
||||||
router/ts/app/crisis-center/crisis-center.routing.ts`,
|
router/ts/app/crisis-center/crisis-center.routing.ts`,
|
||||||
'lazy-load-crisis-center,lazy-load-crisis-center',
|
'lazy-load-crisis-center,lazy-load-crisis-center',
|
||||||
`app.routing.ts (load children),
|
`app.routing.ts (load children),
|
||||||
|
@ -1725,7 +1725,7 @@ figure.image-display
|
||||||
If our initial redirect went to `/heroes` instead of going to `/crisis-center`, the `CrisisCenterModule` would not be loaded until the user
|
If our initial redirect went to `/heroes` instead of going to `/crisis-center`, the `CrisisCenterModule` would not be loaded until the user
|
||||||
visited a `Crisis Center` route. We'll update our redirect in our `app.routing.ts` to make this change.
|
visited a `Crisis Center` route. We'll update our redirect in our `app.routing.ts` to make this change.
|
||||||
|
|
||||||
+makeExample('router/ts/app/app.routing.ts', 'heroes-redirect', 'app.routing.ts (heroes redirect)')
|
+makeExample('router/ts/app/app.routing.6.ts', 'heroes-redirect', 'app.routing.ts (heroes redirect)')
|
||||||
|
|
||||||
<a id="final-app"></a>
|
<a id="final-app"></a>
|
||||||
.l-main-section
|
.l-main-section
|
||||||
|
|
Loading…
Reference in New Issue