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:

UseQuery React for Efficient Data Fetching

 https://daily.dev/blog/usequery-react-for-efficient-data-fetching If you're diving into React and looking to manage data fetching effic...