this.form = this.fb.group({
prop1: '',
prop2: ''
});
this.form.valueChanges.pipe(startWith(null), pairwise())
.subscribe(([prev, next]: [any, any]) => {
console.log('PREV2', prev);
console.log('NEXT2', next);
});
Run Code Online (Sandbox Code Playgroud)
使用此代码我可以获得以前的值和当前值。我想要的是有什么方法可以获取更改的字段、上一个值和当前值。
就像字段更改名称:prop1,上一个值:“”,当前值:“下一个值”