【发布时间】:2020-06-25 15:23:35
【问题描述】:
您好,我的代码出现错误。我有一个 Angular 5 formGroup,我正在尝试在里面使用管道操作和 switchMap。
但是它给了我一个错误。以下是我的代码sn-p。
this.formGroup.valueChanges.pipe(
switchMap(
(formValue) => {
console.log(formValue);
}
)
).subscribe();
错误i如下
Argument of type '(formValue: any) => void' is not assignable to parameter of type '(value: any, index: number) => ObservableInput<{}>'.
Type 'void' is not assignable to type 'ObservableInput<{}>'.ts(2345)
非常感谢任何帮助 谢谢你
【问题讨论】: