I have an Angular 2 app that is connecting to a Web Api backend. There is an endpoint that returns a byte[] of an image that is stored in a sql database. How can I display this as an image in Angular? I can change either the Web Api or Angular app.
My Web Api endpoint looks like this...
[Route("api/profileimage/{userId}")]
public byte[] Get(string userId)
{
var image = _profileImageService.GetProfileImage(userId);
return image;
}
And my Angular HTML looks like this...
<img src="http://localhost:2116/api/ProfileImage/{{tile.UserId}}" width="100" height="100"/>
What conversion do I need to do, or what should the api serve up?