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

168
Vistas
Can services in Angular be decouple like microservices?

In my example code I have two services: FooService and BarService.

BarService is calling foo() function from FooService.

AppComponent is inject the BarService and calling to bar() function from BarService.

Right now, BarService is depend on FooService.

I wounding if there is a way to make BarService not be depend on FooService? so they not talk with each other and will not know about each other?

I saw in microservice approach that services can talk with each other without direct connection by using http-request.

This is apply to this use case?

https://stackblitz.com/edit/angular-ivy-aphlkt?file=src%2Fapp%2Fbar%2Fbar.module.ts,src%2Fapp%2Ffoo%2Ffoo.service.ts,src%2Fapp%2Fapp.component.ts


@Injectable({ providedIn: 'root' })
export class BarService {
  constructor(private fooService: FooService) {}

  bar() {
    console.log('in bar');

    this.fooService.foo();
  }
}
about 4 years ago · Juan Pablo Isaza
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