I have error with FormData in Angular 8. Error is "'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at Function.invokeGetter" and get Empty array with this error.
I wondered if I have syntax error or logic error
My html
<form #f="ngForm" >
<img *ngFor='let url of PhotoModels' [src]="url" height="200">
<br/>
<input type='file' #fileInput (change)="onSelectFile($event)" multiple>
<button (click)="submit(f)" class="btn btn-success">save</button>
</form>
My Component
public PhotoModels = [];
@ViewChild('fileInput', { static: false }) fileInput:ElementRef
submit(f) {
var PhotosElement: HTMLInputElement= this.fileInput.nativeElement
this.PhotosService.Createphotos(PhotosElement.files)
}
My service
Createphotos(Photo) {
let formData = new FormData();
formData.forEach
for(let i =0; i < Photo.length; i++){
formData.append("Photos", Photo[i]);
}
console.log(formData)
}