I am encountering an issue with a particular function
handleFileInput(file: any) {
let promise = new Promise((resolve, reject) => {
this.uploadFileDetails.push({ filename:this.FileName,filetype:this.FileType});
...
resolve(data.Location);
return promise;
}
After looping through this.uploadFileDetails
, I am getting an error
ERROR TypeError: Cannot read properties of undefined (reading 'push')
<div *ngFor="let fileDetails of uploadFileDetails">
</div>
However, when I remove the loop, the values are being saved properly.
If anyone has a solution to this problem, I would greatly appreciate it. Thank you!