X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Fapp.module.ts;h=ccb148f85be7cff87ba22e072ba38886d842594b;hb=3ee8563f09928614951f37314e79a2bf9a90c43a;hp=b76b39dbdf994b3c5c6dda7007425fe5a9ec4f22;hpb=e4c5a4495ba6ae5a30b48445f7f05df0328a6b35;p=examples%2Fangular-tour-of-heroes diff --git a/src/app/app.module.ts b/src/app/app.module.ts index b76b39d..ccb148f 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -4,11 +4,17 @@ 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'; +import { StoreModule } from '@ngrx/store'; +import { reducers, metaReducers } from './reducers'; @NgModule({ declarations: [ @@ -16,13 +22,25 @@ import { DashboardComponent } from './dashboard/dashboard.component'; HeroesComponent, HeroDetailComponent, MessagesComponent, - DashboardComponent + DashboardComponent, + HeroSearchComponent ], imports: [ BrowserModule, AppRoutingModule, FormsModule, - HttpClientModule + 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 } + ), + + StoreModule.forRoot(reducers, { + metaReducers + }) ], providers: [], bootstrap: [AppComponent]