I get the warning
Circular dependency detected!
in Angular 6 and I know why this problem appears, but it is not a problem at all.
I am currently working with SVG, and in my logic I prevent possible problems so I just want to suppress this warning. How can I do that?
I will fix this problem afterwards but for now I want to keep it because my code is more structured this way.
In some scenarios, we can duplicate the required code and solve circular dependency. Or we can create a new service and move that code to that new service to avoid circular dependency.
Avoiding circular dependencies by refactoring Circular dependencies create tight couplings between the classes or modules involved, which means both classes or modules have to be recompiled every time either of them is changed.
A cyclic dependency exists when a dependency of a service directly or indirectly depends on the service itself. For example, if UserService depends on EmployeeService , which also depends on UserService . Angular will have to instantiate EmployeeService to create UserService , which depends on UserService , itself.
A circular dependency occurs when two classes depend on each other. For example, class A needs class B, and class B also needs class A. Circular dependencies can arise in Nest between modules and between providers. While circular dependencies should be avoided where possible, you can't always do so.
Here the right path into the angular.json file :
projects -> architect -> options - > "showCircularDependencies": false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With