After updating to Angular 5, I get an error message with my store module. Angular-Redux now has the Version 7.1.0
Unhandled Promise rejection: StaticInjectorError(AppModule)[StoreModule -> NgReduxRouter]: StaticInjectorError(Platform: core)[StoreModule -> NgReduxRouter]: NullInjectorError: No provider for NgReduxRouter! ; Zone: ; Task: Promise.then ; Value: Error: StaticInjectorError(AppModule)[StoreModule -> NgReduxRouter]:
StaticInjectorError(Platform: core)[StoreModule -> NgReduxRouter]: NullInjectorError: No provider for NgReduxRouter! at _NullInjector.get [...]
Here you can see my Store module
import { NgModule, isDevMode } from '@angular/core';
// Angular-redux ecosystem stuff.
// @angular-redux/form and @angular-redux/router are optional
// extensions that sync form and route location state between
// our store and Angular.
import { NgReduxModule, NgRedux, DevToolsExtension } from '@angular-redux/store';
import { NgReduxRouterModule, NgReduxRouter } from '@angular-redux/router';
import { provideReduxForms } from '@angular-redux/form';
// The top-level reducers and epics that make up our app's logic.
import { IAppState, rootReducer, INITIAL_STATE } from './store';
@NgModule({
declarations: [
],
imports: [NgReduxModule, NgReduxRouterModule],
exports: [
]
//providers: [RootEpics],
})
export class StoreModule {
constructor(
public ngRedux: NgRedux<IAppState>,
devTools: DevToolsExtension,
ngReduxRouter: NgReduxRouter,
) {
// Tell Redux about our reducers and epics. If the Redux DevTools
// chrome extension is available in the browser, tell Redux about
// it too.
// devTools nur im Developmentmodus
var enhancers = isDevMode() ? [devTools.enhancer()] : [];
ngRedux.configureStore(rootReducer, INITIAL_STATE, [], enhancers);
// Enable syncing of Angular router state with our Redux store.
if (ngReduxRouter) {
ngReduxRouter.initialize();
}
// Enable syncing of Angular form state with our Redux store.
provideReduxForms(ngRedux);
}
}
Who knows what to do?
Try changing NgReduxRouterModule
to NgReduxRouterModule.forRoot()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With