STOP USING SERVICES FOR COMPONENTS INTERACTION!!!
Service is a stateless concept in programming, it can only rely on the input and other injected services to produce its output. Storing data inside service(although works) is counter-pattern (since your service is now stateful).
You can achieve what you need with binding @Input() and @Output() of components:
//main container html
<A></A>
<router-outlet (activate)="onRouterOutletActivate($event)"></router-outlet>
//main container ts
@ViewChild(ComponentA, {static: false}) a : ComponentA;
onRouterOutletActivate(event: ContainerOfB): void {
this.activeRouteComponent = event;
// make sure doStuff method is defined public in ComponentB
// clickOutput is an @Output() on ComponentA which propagates click event
this.a.clickOutput.subscribe(() => this.activeRouteComponent.b.doStuff());
}
//ContainerOfB, the container that has B in it
@ViewChild(ComponentB, {static: false}) b : ComponentB;
//ComponentA html
<button (click)="callback()">button</button>
//ComponentA ts
@Output() clickOutput: EventEmitter<void> = new EventEmitter<void>()
callback() { this.clickOutput.emit(); }
You would also achieve asynchronicity and reactiveness which is strongly emphasized by having rxjs in the core of Angular (whereas with service approach you won't).
I get that sharing service for component communication is less complex than the above approach but just because it works it doesn't mean you should do it. If you're locked out of your Mercedes, what would you rather do: breaking the window glass and unlocking the door or calling the locksmith to come over and unlock it.
p.s. Angular is dope hence the analogy(Mercedes)