angular-cn/public/docs/_examples/ngmodule/ts/app/app-routing.module.ts

20 lines
584 B
TypeScript
Raw Normal View History

2016-07-12 18:14:13 -07:00
// #docregion
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
2016-07-12 18:14:13 -07:00
export const routes: Routes = [
{ path: '', redirectTo: 'contact', pathMatch: 'full'},
// #docregion lazy-routes
{ path: 'crisis', loadChildren: 'app/crisis/crisis.module#CrisisModule' },
{ path: 'heroes', loadChildren: 'app/hero/hero.module#HeroModule' }
2016-07-12 18:14:13 -07:00
// #enddocregion lazy-routes
];
// #docregion forRoot
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule {}
2016-07-12 18:14:13 -07:00
// #enddocregion forRoot