ng-docs.github.io
ng-docs.github.io copied to clipboard
应该如何处理文件间的循环依赖?
在此前 https://github.com/ng-docs/ng-docs.github.io/issues/150 中,因为无法直接引用 Sylvester,现在我改为参考其源代码自行实现。目前遇到一个问题:
三维基本元素包括:vector、line、line-segment、plane,在进行三维运算时,不可避免地会涉及到相互引用。
目前的实现运行正常,但是在 > ng serve
是会有多个循环依赖警告:
WARNING in Circular dependency detected:
src\app\core\services\geo3d\line.ts -> src\app\core\services\geo3d\vector.ts -> src\app\core\services\geo3d\line.ts
WARNING in Circular dependency detected:
src\app\core\services\geo3d\plane.ts -> src\app\core\services\geo3d\vector.ts -> src\app\core\services\geo3d\line.ts -> src\app\core\services\geo3d\line-segment.ts -> src\app\core\services\geo3d\plane.ts
请问这种问题一般怎么解决?
只要没error就可以正常使用.....如果你觉得看起来不好看,那么angular.json中有个忽略循环依赖警告的参数 解决方法无非就是.....写在同一个文件
最终决定从类中把关系运算逻辑剥离出来