How to Upload Image Angular2
<p>How can I send a file image in angular2 to my backend?
I have this in my component.html:</p>

<pre><code>&lt;input type="file" [(ngModel)]="selectedImage" /&gt;
&lt;button  (click)="uploadImage($event, selectedImage)"&gt;Save&lt;/button&gt;
</code></pre>

<p>but in my function, <code>selectedImage</code> is undefined.</p>

<pre><code>uploadImage($event, file) {
    console.log(file); //file is undefined
}
</code></pre>