我一直在看几个种子项目,所有的组件似乎有一个index.ts从该组件输出*。我不能在任何地方找到它实际使用的是什么?
例如https://github.com/mgechev/angular2-seed/tree/master/src/client/app/%2Bhome
谢谢
从
https://angular.io/docs/ts/latest/guide/glossary.html桶
原文链接:https://www.f2er.com/angularjs/145861.htmlA barrel is a way to rollup exports from several modules into a single
convenience module. The barrel itself is a module file that re-exports
selected exports of other modules.Imagine three modules in a heroes folder:
06000
Without a barrel,a consumer would need three import statements:
06001
We can add a barrel to the heroes folder (called index by convention)
that exports all of these items:06002
Now a consumer can import what it needs from the barrel.
06003
The Angular scoped packages each have a barrel named index.
参见Angular 2 DI Error – EXCEPTION: Can’t resolve all parameters