title: tslint / codelyzer / ng lint error: "for (... in ...) statements must be filtered with an if statement"
body: <p>Lint error message: </p>
  
  <blockquote>
    <p>src/app/detail/edit/edit.component.ts[111, 5]: for (... in ...)
    statements must be filtered with an if statement</p>
  </blockquote>
  
  <p>Code snippet (It is a working code. It is also available at <a href="https://angular.io/docs/ts/latest/cookbook/form-validation.html" rel="noreferrer">angular.io form validation section</a>):</p>
  
  <pre><code>for (const field in this.formErrors) {
        // clear previous error message (if any)
        this.formErrors[field] = '';
        const control = form.get(field);
  
        if (control &amp;&amp; control.dirty &amp;&amp; !control.valid) {
          const messages = this.validationMessages[field];
          for (const key in control.errors) {
            this.formErrors[field] += messages[key] + ' ';
          }
        }
      }
  </code></pre>
  
  <p>Any idea how to fix this lint error?</p>