我在 Angular 中有一个带有表单数组的表单,您可以在其中添加或删除数据。目前,在将表单标记为脏期间,它不包括按下删除按钮。有没有办法做到这一点?谢谢!
最佳答案
像这样尝试:
this.Form.get('control').markAsDirty();
this.Form.get('control').updateValueAndValidity();
哪里:
Form : FormGroup and control (make it dirty) is control in Form
关于javascript - 在 Angular 4 的表单中按下按钮时,如何将表单状态更改为脏状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51822887/