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:

URL parameters with React Router

 https://ui.dev/react-router-url-parameters If you're reading this, you're probably familiar with the idea of function parameters. T...