title: How to trigger the file upload input in Angular?
body: <p>How to trigger the file upload input in Angular 4? I'm trying, but it's not working.</p>
  
  <p>Instead of input button, I have to click on div and trigger the input type button.</p>
  
  <p>app.html:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;input id="custom-input" type="file" &gt; 
  &lt;div (click)="myEvent(custom-input)"&gt;
      Click here to upload file
  &lt;/div&gt;
  </code></pre>
  
  <p>app.ts:</p>
  
  <pre class="lang-ts prettyprint-override"><code>myEvent(event) {
      alert("event");
      event.nativeElement.click();
  }
  </code></pre>