title: ngClass angular with field logic as param
body: <p>i want to create dynamic class on field change not on form submitted
  the problem i have no idea to make it true :D please help me</p>
  
  <p>this is my component html</p>
  
  <pre><code> &lt;div [ngClass]="formGroup"&gt;
    &lt;label for="name"&gt;Name&lt;/label&gt;
    &lt;input type="text" class="form-control" id="name" required (ngModel)]="model.name" name="name" #name="ngModel"&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>this is my ts</p>
  
  <pre><code>formGroup = {
      'form-group': true,
      'has-error': heroForm.name.invalid
    }
  </code></pre>