我试图在其中一个流更改后触发操作:
import {Observable} from 'rxjs/Observable';
import 'rxjs/add/operator/startWith';
const from$: Observable<number> = this.form.controls['input1'].valueChanges;
const to$: Observable<number> = this.form.controls['input2'].valueChanges;
Observable
.combineLatest(
from$.startsWith(0),
to$.startsWith(0),
(a, b) => {
console.log(a, b);
});
问题是我收到了一个错误:
error TS2339: Property 'startsWith' does not exist on type 'Observable<number>'.
此代码有什么问题?