Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 175
  • Last Modified:

Image File not found AngularJS

Here is the way I am loading image and image model is a link somthing like "http:\\..\123.jpg"

It works well if the file exists. But if the file does not exist it gives 404 error. How to fix these?

           
           <div data-ng-controller="ImageCtrl">
                                    <div  data-ng-repeat="ImageModel in imageList">
                                            <img  data-ng-src="{{ImageModel}}" alt="" />
                                    </div>
                               </div>

Error:

<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>404 - File or directory not found.</h2>
  <h3>The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.</h3>
 </fieldset></div>
</div>
0
rbhargaw
Asked:
rbhargaw
  • 2
  • 2
1 Solution
 
rbhargawAuthor Commented:
Using this link but not sure if the directive is getting fired or not


http://jsfiddle.net/FdKKf/
0
 
leakim971PluritechnicianCommented:
yes, it work fine, the image is replace by the google icon when it fail
0
 
rbhargawAuthor Commented:
I was using fallbacksrc instead of fallback-src so default image is coming however I still get 404 error in the debugger. Any way to get rid of that?
0
 
leakim971PluritechnicianCommented:
no, it must throw the error (the 404), the directive don't prevent 404 error
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now