X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Fapp.module.ts;h=cffb82ad5984bc797b656a18c99b1e5991d28d57;hb=681885aac6e28f9c5aa59aaa904b158001851387;hp=f65716351aa5930fea545e1e3f016e2980c1f483;hpb=fe13c256eb0be311a34d88c35f91b3d519b19f12;p=examples%2Fangular-tour-of-heroes diff --git a/src/app/app.module.ts b/src/app/app.module.ts index f657163..cffb82a 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,14 +1,38 @@ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; +import { AppRoutingModule } from './app-routing.module'; +import { FormsModule } from '@angular/forms'; +import { HttpClientModule } from '@angular/common/http'; + +import { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api'; +import { InMemoryDataService } from './in-memory-data.service'; import { AppComponent } from './app.component'; +import { HeroesComponent } from './heroes/heroes.component'; +import { HeroDetailComponent } from './hero-detail/hero-detail.component'; +import { MessagesComponent } from './messages/messages.component'; +import { DashboardComponent } from './dashboard/dashboard.component'; @NgModule({ declarations: [ - AppComponent + AppComponent, + HeroesComponent, + HeroDetailComponent, + MessagesComponent, + DashboardComponent ], imports: [ - BrowserModule + BrowserModule, + AppRoutingModule, + FormsModule, + HttpClientModule, + + // The HttpClientInMemoryWebApiModule module intercepts HTTP requests + // and returns simulated server responses. + // Remove it when a real server is ready to receive requests. + HttpClientInMemoryWebApiModule.forRoot( + InMemoryDataService, { dataEncapsulation: false } + ) ], providers: [], bootstrap: [AppComponent]