Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Image File not found AngularJS

Posted on 2014-09-23
4
Medium Priority
?
169 Views
Last Modified: 2014-09-24
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
Comment
Question by:rbhargaw
  • 2
  • 2
4 Comments
 

Author Comment

by:rbhargaw
ID: 40340541
Using this link but not sure if the directive is getting fired or not


http://jsfiddle.net/FdKKf/
0
 
LVL 83

Expert Comment

by:leakim971
ID: 40340547
yes, it work fine, the image is replace by the google icon when it fail
0
 

Author Comment

by:rbhargaw
ID: 40340575
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
 
LVL 83

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 40340582
no, it must throw the error (the 404), the directive don't prevent 404 error
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question