Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress "Circular dependency detected" suppress warning in Angular 6

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.

like image 510
Korbson Avatar asked Jun 11 '18 13:06

Korbson


People also ask

How do I fix warning in circular dependency detected?

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.

How do I stop 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.

What is circular dependency error in angular?

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.

What causes circular dependency?

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.


1 Answers

Here the right path into the angular.json file :

projects -> architect -> options - > "showCircularDependencies": false
like image 93
Marcello Kabora Avatar answered Oct 12 '22 20:10

Marcello Kabora