displaying an embedded image in angular2

Viewed 24617

I'm working on a project in angular2, which involves loading an image from a database directly (base64 encoded). In angular1, one could simply load it as follows:

<img data-ng-src="data:image/jpg;base64,{{entry.img}}" />

where entry.img is the raw image data. However, I have no idea how to do this in angular2. I've tried

<img [src]="data:image/jpg;base64,{{entry.img}}" />

but that doesn't work, as angular still tries to load the image from a URL.

2 Answers
Related