I have this problem when i am trying to display selected image before upload image
company.component.ts
handleFileInput(file: File){
console.log(file);
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = event => {
this.imageUrl = event.target.result;
console.log(this.imageUrl);
};
}
HTML
<input
type="file"
#fileInput
(change)="handleFileInput(fileInput.files[0])"
/>
<img [src]="imageUrl" height="50px" alt="">

The following is an example of how it might be implemented:
Component:
Template: