0

I use angularjs in laravel5.4 ,I get this Error in my console I dont know why it happen because the source of prb like showing in the console caused by this link of image :

<img class="lazy" src="/{% food.image_principale %}">

The think is this image is displaying correctly but in console I have this:

 GET http://livrer/%7B%%20item.getData().image_principale%20%%7D 400 (Bad Request)   %7B%%20item.getData().image_principale%20%%7D:1

I dont understand why the console show an error where it is not because I get what I need.

MedKostali
  • 223
  • 1
  • 5
  • 16

1 Answers1

1

This question has been asked (and answered) before already.

Short answer: Replace src inside the html-attribute with ng-src.

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. (Source)

Community
  • 1
  • 1
Philipp Meissner
  • 5,273
  • 5
  • 34
  • 59