Angular2 - 导入桶在运行时导致404

时间:2016-05-12 10:22:00

标签: import typescript angular

我正在尝试实现此链接中描述的导入桶结构(您可能需要向下滚动一点):

https://angular.io/docs/ts/latest/guide/style-guide.html#!#application-structure

我面临的问题是我正在创建和引用的index.ts文件,如

import {...} from './shared/services';
在运行时找不到

并且正在抛出404。如果我引用像

这样的模块
import {...} from './shared/services/index';

工作正常。问题只出现在运行时,打字稿不会抱怨并成功编译。我在一个plunker中重复了这个问题:

https://plnkr.co/edit/ClE76zuihFTETLDGehnd?p=preview

您可以在控制台中看到错误。

提前感谢您的帮助!

0 个答案:

没有答案