Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

156
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda