Here i choose multiple images and shows using *ngFor
And there I have placed a delete button which is appear in the screenshot, click on delete button i want to
event.target.files is already an array, which is why you can iterate over it with ngFor. When you assign selectedFile = event.target.files, you are making it an array. Try this:
selectedFile: File;
ArrayOfSelectedFile = new Array();
onFileChanged(event : any) {
this.selectedFile = event.target.files[0];
this.ArrayOfSelectedFile = event.target.files;
}
removeSelectedFile(index){
this.ArrayOfSelectedFile.splice(index,1);
}
{{selected.name}}