ng-docs.github.io icon indicating copy to clipboard operation
ng-docs.github.io copied to clipboard

应该如何处理文件间的循环依赖?

Open lymimt opened this issue 3 years ago • 2 comments

在此前 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

请问这种问题一般怎么解决?

lymimt avatar Jul 15 '20 07:07 lymimt

只要没error就可以正常使用.....如果你觉得看起来不好看,那么angular.json中有个忽略循环依赖警告的参数 解决方法无非就是.....写在同一个文件

wszgrcy avatar Jul 16 '20 01:07 wszgrcy

最终决定从类中把关系运算逻辑剥离出来

lymimt avatar Jul 17 '20 08:07 lymimt