美文网首页
解决for (... in ...) statements mu

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

作者: freding | 来源:发表于2019-08-04 12:44 被阅读0次

    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();
    }

    相关文章

      网友评论

          本文标题:解决for (... in ...) statements mu

          本文链接:https://www.haomeiwen.com/subject/axzedctx.html