I have a requirement to bind a list of employee on UI, which is already done using *ngFor.
Now, I wanted to bind image for each employee using pipe. In pipe for every employee I have to hit the server to get the Image(it returns in Base64 format).
Problem: It's not working when I am try to get the image using subscriber.
this.userSerivce.GetProfileImage(ntnet).subscribe(img => {
if (img !== '' && img !== undefined && img.length > 64) {
return prefix + img;
} else {
return profileImage;
}
});
And on UI in src attribute I can see this
src=(unknown)
Note:
If getting all images along with employee it self from API then the response become very slow due to image processing (getting img from ntnet).
Is there any other best way to bind dynamic images on UI without freezing the UI