1

if I used this code, it generates error "Failed to load resource", although the image renders correctly.

<img src="data:image/png;base64, {{image|| 'R0lGODlhAQABAIAAAP7//wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=='}}">

I use the directive ngCloak and ngBind but still showing the error.

1 Answer 1

6

You most likely need to use ngSrc so that the src attribute doesn't render before Angular can interpolate the expression.

Sign up to request clarification or add additional context in comments.

2 Comments

Using Angular markup like {{hash}} in a src attribute doesn't work right: The browser will fetch from the URL with the literal text {{hash}} until Angular replaces the expression inside {{hash}}. The ngSrc directive solves this problem.
Sweet, happy to help. You should consider accepting the answer if it has helped you. Cheers!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.