title: Angular 5 how to get file name from input with type = file
body: <p>I know there are simmilar questions but none cover the method for Angular 5 or at least not in a way that I understand it.</p>
  
  <p>For my image upload system I need to know if a picture is attached to the input tag and what name the file has. Here is my code:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input 
    type="file" 
    [(ngModel)]="currentInput"
    (change)="onFileSelected($event)"
  &gt;
  </code></pre>
  
  <p>Angular:</p>
  
  <pre><code>export class ImageUpload {
      currentInput;
  
      onFileSelected(event) {
          console.log(this.currentInput);
      }
  }
  </code></pre>
  
  <p>No matter if there is a file attached or not the value in "currentInput" is always undefined. How does this work with input when the type is equal to "file"?</p>
  
  <p>Thanks!</p>