I'm trying to implement NgOptimizedImage
in my angular app.
<img [ngSrc]="imageUrl" width="196" height="196">
imageUrl
is url to my server. The response is buffer. I used to convert the buffer to string in component.ts file and then using [src]="convertedBuffer"
show the image. But NgOptimizedImage
requires src, so it loads from the server when the image can be seen.
Do I have to convert the buffer to string on server, or is there a way to convert it to string on client side?