title: Validating form-field-input inside mat-table (Angular 7)
body: <p>I have a mat-form-field with a mat-input, which resides inside a material-table. Since the data is inside the material-table-datasource, I can't use a formgroup and validate the input that way. Is there any other method or 'work-around' I could use to approach this?</p>
  
  <p>The field is set up like this:</p>
  
  <pre><code>&lt;ng-container matColumnDef="rate"&gt;
    &lt;mat-header-cell *matHeaderCellDef mat-sort-header&gt;Currency rate&lt;/mat-header-cell&gt;
    &lt;mat-cell class="description-cell" *matCellDef="let data"&gt;
      &lt;mat-form-field class="rate-form-field"&gt;
        &lt;input matInput [value]="data.currencyRate" (focusin)="setValue(data.currencyRate)" (focusout)="checkDirty($event, data)"  placeholder="Rate"&gt;
      &lt;/mat-form-field&gt;
    &lt;/mat-cell&gt;
  &lt;/ng-container&gt;
  </code></pre>
  
  <p>The value is bound directly from the material-table-datasource. On focusin I save the current value and on focusout I check the saved value against the actual value in the input field. If it is different, I change the value in the datasource. What I want to achieve is that I try to save when it is empty and/or with invalid number/letters, it should throw an error underneath the form-field.</p>