【问题标题】:In Angular 2.4, failed to import a feature module from a different project to the main project在 Angular 2.4 中,无法将功能模块从不同的项目导入到主项目
【发布时间】:2017-01-20 03:43:12
【问题描述】:

我有两个项目,一个是主项目,第二个项目是共享项目。在共享项目中,我创建了一个名为 NavBar 的功能模块。

之所以分成不同的项目,是为了在不同的项目中复用NavBar模块。

我想通过使用将 NavBar 功能模块导入到主项目中

import { NavBarModule } from '../../SharedProject/app/shared/navbar/navbar.module'

不幸的是,我收到一条错误消息,提示它尝试使用 get 方法导入

(SystemJS) XHR 错误 (404 Not Found) loading http://localhost/ShareProject/app/shared/navbar/navbar.module

请问正确的做法是什么?

【问题讨论】:

    标签: angular systemjs angular2-modules


    【解决方案1】:

    很难说你的代码有什么问题,你没有提供足够的信息/代码。

    也许这会有所帮助:

    Angular 2 - moving modules to their own project

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-11
      • 1970-01-01
      • 1970-01-01
      • 2021-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-01
      相关资源
      最近更新 更多