how to trigger event click at input type=“file” by function in angular 2?

Source: https://stackoverflow.com/questions/38261859/how-to-trigger-event-click-at-input-type-file-by-function-in-angular-2

Pass the fileInput reference to triggerFile() and do the fileInput.click() there instead:
<input #fileInput type="file"  />
<button type="button" (click)="triggerFile(fileInput)">trigger</button>
triggerFile(fileInput:Element) {
  // do something
  fileInput.click();
}

Không có nhận xét nào:

Cold Turkey Blocker

 https://superuser.com/questions/1366153/how-to-get-rid-of-cold-turkey-website-blocker-get-around-the-block Very old question, but still wan...