【发布时间】:2016-09-08 02:53:00
【问题描述】:
我正在尝试实现此链接中描述的导入桶结构(您可能需要向下滚动一点):
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
您可以在控制台中看到错误。
提前感谢您的帮助!
【问题讨论】:
-
我可以自己重现这种行为。我会更深入地研究这个问题,如果我能找到一些东西,我会通知你
标签: import typescript angular