Registering our reducer with the store

Lastly, we just need to do a slight update to the app.module.ts file to have it point correctly to our JediListReducer, like so:

// app.module.ts

import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { StoreModule } from "@ngrx/store";
import { AppComponent } from "./app.component";
import { counterReducer } from "./reducer";
import { JediModule } from './jedi/jedi.module';
import { jediListReducer } from "./jedi/jedi-list/jedi-list.reducer";

@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
StoreModule.forRoot({
counter: counterReducer,
jediList: JediListReducer
}),
JediModule
],
bootstrap: [AppComponent]
})
export class AppModule {}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.13.184