this.validateForm.reset()
    for (const key in this.validateForm.controls) {
      this.validateForm.controls[key].markAsPristine()
      this.validateForm.controls[key].updateValueAndValidity()
    }

markAsPristine()是将表单控件值标记为未改变,这个方法主要用在表单重置时、updateValueAndValidity()是重新计算表单控件的值和验证状态等。

相关文章:

  • 2021-10-30
  • 2021-12-01
  • 2021-12-28
  • 2021-11-10
  • 2021-07-26
  • 2022-03-02
  • 2021-05-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
  • 2021-05-04
  • 2022-12-23
  • 2022-12-23
  • 2021-06-23
相关资源
相似解决方案