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

339
Visualizações
Can we use a common service without module into other module (specifically controller) in NestJs?

I am working on a NestJs project. There are different modules. I want to have a common service without module that can b used anywhere in the app. Is it possible to use a common service without module? If yes then how can i use it? Actually i want to use different functions from a service.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

if you want to use service term you need to register @Injectable() service to a module you can register it to app.module.ts, but it depends on what common.service.ts exactly do ?

if you want to use a dependency injection mechanism of Nestjs you should add @Injectable and a Scope then register it into whatever module do you want.

if you got the answer plz vote me up :), if not leave a comment with more details

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