Solved

Image File not found AngularJS

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now