在Angular2中,我们广泛使用了 index.ts 文件,使 import 和 export 语句更简单 .
由于我们正在升级到 Angular6 ,因此会遇到很多循环依赖问题 . 我们删除或忽略这些 index.ts 文件的那一刻,所有这些依赖性问题都得到了解决 .
所以我们想知道,在Angular6中不再使用 Barrel (index.ts) ?
如果仍然使用,那么它是否有任何变化,以前的使用方式?
它们不被弃用,只是不要从同一目录中引用它们意味着 do not import a symbol from a barrel that export the current file, import from the file itself .
1 回答
它们不被弃用,只是不要从同一目录中引用它们意味着 do not import a symbol from a barrel that export the current file, import from the file itself .