Solved

Image File not found AngularJS

Posted on 2014-09-23
4
148 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 82

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 82

Accepted Solution

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Print Rhino Java Array in Javascript 1 30
Asp response.write to clients 6 32
arrays and buttons with user input 2 31
Why is my $_POST not going to results page 10 32
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
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…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

685 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