<input type="file" accept="image/*"> <button>Upload file</button>
You can leverage template reference variable as follows:
<input type="file" accept="image/*" #file> <button (click)="file.click()">Upload file</button>
The corresponding plunkr is here https://plnkr.co/edit/JB4HY0oxEUgXXIht2wAv?p=preview
2.1m questions
2.1m answers
60 comments
57.0k users