AURIGADL
AURIGADL

Reputation: 2032

angularjs image base64 show error "Failed to load resource"

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.

Upvotes: 1

Views: 2949

Answers (1)

Langdon
Langdon

Reputation: 20063

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

Upvotes: 6

Related Questions