Solved

Image File not found AngularJS

Posted on 2014-09-23
4
153 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
This article discusses how to implement server side field validation and display customized error messages to the client.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
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.

739 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