Hi,
I’m trying to place an image encoded in base64 on a div using ng-style, but the image is not showing. I searched in google and couldn’t find an answer, maybe someone here have had the same problem before.
This is my non working code code.
<div class="blurry" ng-style="{ 'background-image': 'url(data:image/png;base64,{{user.avatar}})' }"></div>
user.avatar contains an image encoded in base64. I’m using the same approach on an image tag an it works, so that’s why I’m wondering why the one I posted above doesn’t.
<img ng-src="data:image/png;base64,{{user.avatar}}" alt="Carlitos Navas" width="100" class="avatar">