I want to display base64 image for profile picture. The image is stored in database as binary data and I converted this binary data into base64 using btoa(). now I want to bind this base64 image to img src I tried many ways but it's not working, please help here is my code
profile.ts code:
profilePicture(binImage)
{
if(binImage != null)
{
var imageData = btoa(binImage);
//console.log("Base64 Image: ",imageData);
this.displayImage = imageData;
}
}
profile.html code:
<div class="profile-picture big-profile-picture" *ngIf="displayImage">
<img src="data:Image/*;base64,{{displayImage}}">
</div>
It is showing an error "sanitizing unsafe url value safevalue must use [property]=binding"