title: Angular 6 Reactive Form Add Error Class Container Div
body: <p>Using an Angular 6 directive or component, what is the simplest error proof solution to adding a has-error class to the container div when the input is invalid etc. </p>
  
  <pre><code>&lt;div class="form-group m-form__group has-error"&gt; // add has-error here.
    &lt;label&gt; Email address &lt;/label&gt;
    &lt;input type="email" class="form-control m-input" formControlName="email"&gt;
    &lt;span class="m-form__help"&gt; Email is required. &lt;/span&gt; 
  &lt;/div&gt;
  </code></pre>