解决for (... in ...) statements mu

2019-08-04  本文已影响0人  freding

for (... in ...) statements must be filtered with an if statement

解决前

for (const key in this.validateForm.controls) {
  this.validateForm.controls[key].markAsDirty();
  this.validateForm.controls[key].updateValueAndValidity();
}

解决后:

for (const key of Object.keys(this.validateForm.controls)) {
  this.validateForm.controls[key].markAsDirty();
  this.validateForm.controls[key].updateValueAndValidity();
}
上一篇下一篇

猜你喜欢

热点阅读