@ngrx/store installiert
[examples/angular-tour-of-heroes] / src / app / app.module.ts
1 import { BrowserModule } from '@angular/platform-browser';
2 import { NgModule } from '@angular/core';
3 import { AppRoutingModule } from './app-routing.module';
4 import { FormsModule } from '@angular/forms';
5 import { HttpClientModule } from '@angular/common/http';
6
7 import { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';
8 import { InMemoryDataService } from './in-memory-data.service';
9
10 import { AppComponent } from './app.component';
11 import { HeroesComponent } from './heroes/heroes.component';
12 import { HeroDetailComponent } from './hero-detail/hero-detail.component';
13 import { MessagesComponent } from './messages/messages.component';
14 import { DashboardComponent } from './dashboard/dashboard.component';
15 import { HeroSearchComponent } from './hero-search/hero-search.component';
16 import { StoreModule } from '@ngrx/store';
17 import { reducers, metaReducers } from './reducers';
18
19 @NgModule({
20   declarations: [
21     AppComponent,
22     HeroesComponent,
23     HeroDetailComponent,
24     MessagesComponent,
25     DashboardComponent,
26     HeroSearchComponent
27   ],
28   imports: [
29     BrowserModule,
30     AppRoutingModule,
31     FormsModule,
32     HttpClientModule,
33
34     // The HttpClientInMemoryWebApiModule module intercepts HTTP requests
35     // and returns simulated server responses.
36     // Remove it when a real server is ready to receive requests.
37     HttpClientInMemoryWebApiModule.forRoot(
38       InMemoryDataService, { dataEncapsulation: false }
39     ),
40
41     StoreModule.forRoot(reducers, {
42       metaReducers
43     })
44   ],
45   providers: [],
46   bootstrap: [AppComponent]
47 })
48 export class AppModule { }