Currently working on a project that involves the following files:
app.component.html
<div>
<input type="file" ([ngModel])="file" accept="application/pdf" onChange="change()">
</div>
app.module.ts:
file: File = null;
change(){
console.log(file);
}
Despite setting up the file input, nothing happens when I select a PDF file. I've searched for solutions but haven't found anything useful. My main goal is to send this selected file via Http, at the very least sending the file name. The project is built with Angular4 using npm.