2016-08-09 17:38:25 +01:00
|
|
|
// #docplaster
|
|
|
|
// #docregion
|
2016-12-20 15:35:06 -06:00
|
|
|
// #docregion first-config
|
2016-10-29 16:08:54 -05:00
|
|
|
import { NgModule } from '@angular/core';
|
|
|
|
import { BrowserModule } from '@angular/platform-browser';
|
|
|
|
import { FormsModule } from '@angular/forms';
|
2016-12-20 15:35:06 -06:00
|
|
|
// #docregion import-router
|
2016-10-29 16:08:54 -05:00
|
|
|
import { RouterModule, Routes } from '@angular/router';
|
2016-12-20 15:35:06 -06:00
|
|
|
// #enddocregion import-router
|
2016-08-09 17:38:25 +01:00
|
|
|
|
2016-12-21 12:08:39 -08:00
|
|
|
import { AppComponent } from './app.component';
|
|
|
|
import { CrisisListComponent } from './crisis-list.component';
|
|
|
|
import { HeroListComponent } from './hero-list.component';
|
2016-12-20 15:35:06 -06:00
|
|
|
// #enddocregion first-config
|
2016-12-21 12:08:39 -08:00
|
|
|
import { PageNotFoundComponent } from './not-found.component';
|
2016-12-20 15:35:06 -06:00
|
|
|
// #docregion first-config
|
2016-08-09 17:38:25 +01:00
|
|
|
|
2016-12-21 12:08:39 -08:00
|
|
|
// #docregion appRoutes
|
2016-10-29 16:08:54 -05:00
|
|
|
const appRoutes: Routes = [
|
|
|
|
{ path: 'crisis-center', component: CrisisListComponent },
|
2016-12-20 15:35:06 -06:00
|
|
|
{ path: 'heroes', component: HeroListComponent },
|
|
|
|
// #enddocregion first-config
|
2016-12-21 12:08:39 -08:00
|
|
|
|
|
|
|
{ path: '', redirectTo: '/heroes', pathMatch: 'full' },
|
|
|
|
// #docregion wildcard
|
2016-12-20 15:35:06 -06:00
|
|
|
{ path: '**', component: PageNotFoundComponent }
|
2016-12-21 12:08:39 -08:00
|
|
|
// #enddocregion wildcard
|
2016-12-20 15:35:06 -06:00
|
|
|
// #docregion first-config
|
2016-10-29 16:08:54 -05:00
|
|
|
];
|
2016-12-21 12:08:39 -08:00
|
|
|
// #enddocregion appRoutes
|
2016-10-29 16:08:54 -05:00
|
|
|
|
2016-08-09 17:38:25 +01:00
|
|
|
@NgModule({
|
|
|
|
imports: [
|
|
|
|
BrowserModule,
|
|
|
|
FormsModule,
|
2016-10-29 16:08:54 -05:00
|
|
|
RouterModule.forRoot(appRoutes)
|
2016-08-09 17:38:25 +01:00
|
|
|
],
|
|
|
|
declarations: [
|
|
|
|
AppComponent,
|
|
|
|
HeroListComponent,
|
2016-12-20 15:35:06 -06:00
|
|
|
CrisisListComponent,
|
|
|
|
// #enddocregion first-config
|
|
|
|
PageNotFoundComponent
|
|
|
|
// #docregion first-config
|
2016-08-09 17:38:25 +01:00
|
|
|
],
|
|
|
|
bootstrap: [ AppComponent ]
|
|
|
|
})
|
2016-12-21 12:08:39 -08:00
|
|
|
export class AppModule { }
|
2016-08-09 17:38:25 +01:00
|
|
|
// #enddocregion
|