I have an endpoint that provides me an image based on certain parameter. It's not an image url, its a plain image. So when i hit the endpoint in postman, in response, i receive an image (JPG).
I do i receive this image in a variable and bind it in tag of HTML?
All the questions have solution for mapping an image url to image, whereas mine is an image which i have to display in UI.
show-image-component.ts
this.appservice.getImage().subscribe((image) => {
console.log(image);
}
)
service.ts
getImg() {
return this.httpClient.get('xyz.com', {headers: this.httpHeaders});
}
How should i display the image i receive in image variable on HTML?