X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Fapp.module.ts;h=c35475af92a51eea59e214e87ce4a137372f21b0;hb=b96b10a45927728a8e0c2234f494fb9eebd3df16;hp=e4e68824f04f7a0ceaf8ed125d8238223859c2bd;hpb=2f6f2d86ff7765914cd9105069181ed1f1792f44;p=examples%2Fangular-tour-of-heroes diff --git a/src/app/app.module.ts b/src/app/app.module.ts index e4e6882..c35475a 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -2,12 +2,17 @@ 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'; +import { HeroSearchComponent } from './hero-search/hero-search.component'; @NgModule({ declarations: [ @@ -15,12 +20,21 @@ import { DashboardComponent } from './dashboard/dashboard.component'; HeroesComponent, HeroDetailComponent, MessagesComponent, - DashboardComponent + DashboardComponent, + HeroSearchComponent ], imports: [ BrowserModule, AppRoutingModule, - FormsModule + 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]