I need to communicate between two services where it has dependency on both A->B and B->A. But getting circular dependency error on achieving it.
@Injectable()
export class ServiceA{
constructor(private serviceB:ServiceB){
}
OnInit(){
this.serviceA.Callme();
}
afterServiceBInitialization(){
//doing logic here
}
}
@Injectable()
export class ServiceB{
constructor(private serviceA:ServiceA){
}
Callme(){
console.log("hello");
this.serviceA.afterServiceBInitialization()
}
}
But getting circular dependency error. How to proceed with this ?