title: TS2345: Argument of type 'Event' is not assignable to parameter of type 'HtmlInputEvent'
body: <p>I am trying to upload a file but I get that error, help me please to compile.</p>
  <p>Angular-----Error:</p>
  <pre><code>src/app/admin/producto/create-producto-dialog.html:38:47 - error TS2345: Argument of type 'Event' is not assignable to parameter of type 'HtmlInputEvent'.
    Types of property 'target' are incompatible.
      Type 'EventTarget | null' is not assignable to type 'HTMLInputElement &amp; EventTarget'.
        Type 'null' is not assignable to type 'HTMLInputElement &amp; EventTarget'.
          Type 'null' is not assignable to type 'HTMLInputElement'.
  
                           (change)=&quot;imgSelected($event)&quot;&gt;
  </code></pre>
  <p>Code from component.ts</p>
  <pre><code>interface HtmlInputEvent extends Event{
    target : HTMLInputElement &amp; EventTarget;
  } 
  
  export class AppComponent implements OnInit {
    
    public file :File;
    public imgSelect : String | ArrayBuffer;
  
    imgSelected(event: HtmlInputEvent){
      if(event.target.files  &amp;&amp; event.target.files[0]){
          this.file = &lt;File&gt;event.target.files[0];
  
          const reader = new FileReader();
          reader.onload = e =&gt; this.imgSelect = reader.result as String;
          reader.readAsDataURL(this.file);
      }
    }
  }
  </code></pre>
  <p>Code from Html</p>
  <pre><code>&lt;div class=&quot;text-center&quot;&gt;
        &lt;img alt=&quot;Chris Wood&quot; [src]=&quot;imgSelect || '../../../../assets/img/default.jpg'&quot; class=&quot;rounded-circle img-responsive mt-2&quot; width=&quot;128&quot; height=&quot;128&quot;&gt;
        &lt;div class=&quot;mt-2&quot;&gt;
            &lt;input class=&quot;btn btn-primary&quot; required (change)=&quot;imgSelected($event)&quot; type=&quot;file&quot; style=&quot;width: 100% !important;&quot;&gt;
        &lt;/div&gt;&gt;
    &lt;/div&gt;
  </code></pre>