首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在System.js模块加载程序中使用@ngrx/store和@ngrx/core

在System.js模块加载程序中使用@ngrx/store和@ngrx/core
EN

Stack Overflow用户
提问于 2017-02-10 15:10:38
回答 1查看 467关注 0票数 5

为了使用@ngrx/store 2.2.1和@ngrx/core 1.2.0进行状态管理,在我的示例角2.4.0应用程序中,我遵循了以下步骤

  1. 已安装@ngrx/store 2.2.1和@ngrx/core
  2. 将以下导入添加到根模块 从“@ngrx/store”导入{ StoreModule };

3在systemjs.config.js文件的包部分添加了下面的代码

代码语言:javascript
复制
 '@ngrx/core': {
          main: 'bundles/core.umd.js',
          format: 'cjs'
      },
      '@ngrx/store': {
          main: 'bundles/store.umd.js',
          format: 'cjs'
      }     

当我浏览到网站时,我在浏览器控制台中出现以下错误。

加载资源失败:服务器响应状态为404 (未找到) "http://localhost:62818/@ngrx/store/bundles/store.umd.js

任何需要修改什么来解决这个问题的想法。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-02-10 16:22:52

正如@ estus提到的,这是一个路径问题。将下面的行添加到具有正确路径的映射部分解决了这个问题。

代码语言:javascript
复制
'@ngrx/core': 'node_modules/@ngrx/core/bundles/core.umd.js',
'@ngrx/store': 'node_modules/@ngrx/store/bundles/store.umd.js',
票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42162651

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档