Reputation: 2492
I have an Angular template:
<div class="item holder" ng-repeat="article in articles">
<div class="col-xs-4 col-sm-4 col-md-3 holder imgHolder">
<a href="{{article.articleLink}}"><img src="{{article.image}}" alt="" /></a>
</div>
</div>
It shows a list of articles.
I'm getting the following error on the console:
GET http://example.com/%7B%7Barticle.image%7D%7D 404 (Not Found)
The template renders the articles correctly but I also get the error.
Why am I getting this error?
Upvotes: 0
Views: 94
Reputation: 4280
First take article.image
and print it to the console console.log
and copy + paste the Url into your browser. Does your browser get a 404
? If this happens then something is wrong without your Url. If this is not the case then:
It looks like AngularJs is replacing some key characters with Url safe characters.
Try using ng-src="article.image"
instead.
If you are still getting a 404 and it still has %7D
's in it then output article.image
to the console to make sure the string is not bad.
Upvotes: 1