I am attempting to create a binding for an input field of type file using ngModel in the standard Angular way as shown below:
<input type="file" id="fileUpload" [(ngModel)]="file">
and
files:any
The issue I am facing is that even after selecting a file, the value of my variable files
remains undefined
.
Here is an example with stackblitz: https://stackblitz.com/edit/angular-6mbdww