reimplemented header navbar toggle using redux

This commit is contained in:
Art Lowel
2016-12-12 14:57:07 +01:00
parent 9aa74b863e
commit 69f8d9855a
8 changed files with 123 additions and 13 deletions

View File

@@ -7,6 +7,12 @@ import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HeaderComponent } from './header/header.component';
import { StoreModule } from "@ngrx/store";
import { StoreDevtoolsModule } from "@ngrx/store-devtools";
import reducers from './app.reducers'
import actions from './app.actions'
@NgModule({
declarations: [
@@ -16,7 +22,29 @@ import { HeaderComponent } from './header/header.component';
imports: [
SharedModule,
HomeModule,
AppRoutingModule
AppRoutingModule,
/**
* StoreModule.provideStore is imported once in the root module, accepting a reducer
* function or object map of reducer functions. If passed an object of
* reducers, combineReducers will be run creating your application
* meta-reducer. This returns all providers for an @ngrx/store
* based application.
*/
StoreModule.provideStore(reducers),
/**
* Store devtools instrument the store retaining past versions of state
* and recalculating new states. This enables powerful time-travel
* debugging.
*
* To use the debugger, install the Redux Devtools extension for either
* Chrome or Firefox
*
* See: https://github.com/zalmoxisus/redux-devtools-extension
*/
StoreDevtoolsModule.instrumentOnlyWithExtension(),
],
providers: [
actions
]
})
export class AppModule {