angular-material-components
angular-material-components copied to clipboard
Opening file-input on button click
I want to be able to open the input from a button like so
<div>
<button (click)="myInput.open()">Upload a file</button>
<mat-form-field appearance="standard">
<mat-label>Your pdf file</mat-label>
<ngx-mat-file-input [multiple]="false" [accept]="'.pdf'" #myInput>
</ngx-mat-file-input>
</mat-form-field>
</div>
However this doesn't work since Property 'open' does not exist on type 'NgxMatFileInputComponent'.
Is there a way to make it work?
(click)="myInput.openFilePicker($event);" or (click)="myInput.openFilePicker();" shoud do the trick