30秒学会 Angular 片段 – Observables as outputs
EventEmitters
used for @Output
‘s are just Observables with an emit method.
This means that you can just use Observable
instance instead, e.g. we can wire up FormControl value changes directly:
readonly checkbox = new FormControl();
@Output() readonly change = this.checkbox.valueChanges;
继续阅读 30秒学会 Angular 片段 – Observables as outputs