更新为角度5后出错:NgReduxRouter没有提供者

Tal*_*dan 5 angular

更新到Angular 5后,我的商店模块收到错误消息.Angular-Redux现在有7.1.0版本

未处理的Promise拒绝:StaticInjectorError(AppModule)[StoreModule - > NgReduxRouter]:StaticInjectorError(Platform:core)[StoreModule - > NgReduxRouter]:NullInjectorError:没有NgReduxRouter的提供者!; 区域:; 任务:Promise.then; 值:错误:StaticInjectorError(AppModule)[StoreModule - > NgReduxRouter]:
StaticInjectorError(Platform:core)[StoreModule - > NgReduxRouter]:NullInjectorError:没有NgReduxRouter的提供者!at _NullInjector.get [...]

在这里,您可以看到我的商店模块

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);
    }
}
Run Code Online (Sandbox Code Playgroud)

谁知道该怎么办?

Nik*_*ric 5

尝试NgReduxRouterModule改为NgReduxRouterModule.forRoot()