Well, as intended to use Observables, this is actually not such a big problem, and it works pretty well. These are no more than a few lines.
Declare in some shared service a service that they share as such, for example, a service declared by the provider in this module, so that you do not get two instances of the same service. Add Subjectto this service a method to retrieve the value:
public configObservable = new Subject<number>();
emitConfig(val) {
this.configObservable.next(val);
}
config:
emit(val) {
this.myService.emitConfig(val);
}
, :
constructor(private myService: MyService) {
this.myService.configObservable.subscribe(value => {
this.value = value;
})
}
-:
@Input(), -, .