Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

159
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda