Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
Angular circular dependency: best practices for handle it

I have UserService and GroupService in my app and it make sense that both services will know each other and use each other functions.

There are several tools in angular that give me to "fix" the circular dependency warning.

But everywhere it is written that if you have circular dependency, it's a sign that you have bad architecture.

So, what is the good architecture for cases like that? Why is it right to force (quite forcibly) one of the services not to know the other?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

So the problem is when one service need to be instantiated, inside constructor it will require second service. But that second service in order to be instantiated, inside constructor it will require first service.

What you can do is move all the logic from these 2 services into one "parent" service, and use this "parent" service through the application.

about 4 years ago · Juan Pablo Isaza Report

0

you have 2 options:

  1. Extract commonly needed parts of the logic into some SharedModule

  2. If some part of any modules logic is required in other modules then it doesn't belong into that feature module but in top level module (the one that starts the app, does core app things and loads other feature modules).

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!