handleFile(event: any) {
const file = event.target.files[0];
if (file) {
const reader = new FileReader();
reader.onload = (e) => {
file.imageSrc = reader.result
}
reader.readAsDataURL(file);
this.files.push(file);
this.fileName = file.name;
}
}
<div *ngFor="let file of files">
<img [src]="file.imageSrc" />
</div>