将Redux安装到Angular 2

时间:2017-06-30 06:31:24

标签: angular redux

我想将Redux安装到我的Angular2项目中,但是我收到了错误消息。我是WebApis和Web Coding的新手。

  

意外的价值' NgReduxModule'由模块' AppModule'。

导入

如何解决此问题?

2 个答案:

答案 0 :(得分:0)

这是我的package.json。还有另一个名为package-lock.json的文件。

    {
  "name": "Portal",
  "version": "1.0.0",
  "private": true,
  "@angular/cli": {
    "version": "^1.2.0"
  },
  "dependencies": {
    "@angular-redux/store": "^6.5.4",
    "@angular/animations": "^4.0.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/compiler-cli": "^4.2.5",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "@angular/cli": "^1.2.0",
    "@angular/platform-server": "2.0.0",
    "@types/node": "^6.0.38",
    "angular2-platform-node": "^2.1.0-rc.1",
    "angular2-universal": "^2.1.0-rc.1",
    "angular2-universal-polyfills": "^2.1.0-rc.1",
    "aspnet-prerendering": "^2.0.6",
    "aspnet-webpack": "^1.0.29",
    "bootstrap": "^3.3.7",
    "css": "^2.2.1",
    "css-loader": "^0.28.4",
    "es6-shim": "^0.35.3",
    "expose-loader": "^0.7.3",
    "extract-text-webpack-plugin": "^2.1.2",
    "file-loader": "^0.11.2",
    "isomorphic-fetch": "^2.2.1",
    "jquery": "^3.2.1",
    "node": "0.0.0",
    "preboot": "^5.0.0-rc.11",
    "raw-loader": "^0.5.1",
    "redux": "^3.7.1",
    "rxjs": "^5.4.1",
    "style-loader": "^0.13.2",
    "to-string-loader": "^1.1.5",
    "ts-loader": "^0.8.2",
    "typescript": "^2.4.1",
    "url-loader": "^0.5.9",
    "webpack": "3.0.0",
    "webpack-externals-plugin": "^1.0.0",
    "webpack-hot-middleware": "^2.18.0",
    "webpack-merge": "4.1.0",
    "zone.js": "0.8.12"
  }
}

答案 1 :(得分:0)

我解决了自己的问题。

我喜欢我的例子

import { NgRedux, NgReduxModule } from 'ng2-redux';

但是对了

import { NgRedux, NgReduxModule } from '@angular-redux/store'; 

感谢所有阅读并希望帮助我的人。