angular-material-components icon indicating copy to clipboard operation
angular-material-components copied to clipboard

File input form control is an empty object

Open sterichards opened this issue 3 years ago • 1 comments

<mat-form-field [appearance]="'outline'">
  <ngx-mat-file-input
    [multiple]="false"
    [accept]="'image/*'"
    [formControl]="this.fileFormControl"
  ><mat-icon ngxMatFileInputIcon>add_a_photo</mat-icon>
  </ngx-mat-file-input>
</mat-form-field>

<pre>{{this.fileFormControl.value|json}}</pre>

This just shows an empty object after a file has been selected

How is it possible to access the binary of the file so I can post the data to an API endpoint?

sterichards avatar Sep 15 '22 13:09 sterichards

Tried this component as well and couldn't figure it out. Seems like completely pointless component.

jurvi avatar Feb 16 '23 17:02 jurvi