[英]Why can't my program find the images?
When I go straight into the directory via the browser, in other words localhost:8888/images/mansion-1.jpg, the image appears on the browser, but on the console, it says 404, it can't find the images. 当我通过浏览器直接进入目录时,即localhost:8888 / images / mansion-1.jpg,该图像出现在浏览器上,但是在控制台上显示为404,找不到该图像。 Can anybody assist me in figuring out why it cant retrieve the images? 有人可以协助我弄清楚为什么它无法检索图像吗?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ng-mansions</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body ng-app="ngMansions" ng-controller="mansionsController">
<!--Nav Bar-->
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">mc-mansions</a>
</div>
</div>
</nav>
<!--Real Estate Listings-->
<div class="container">
<div class="col-sm-4" ng-repeat="mansion in mansions">
<div class="thumbnail">
<img ng-src="images/{{mansion.image}}.jpg" alt="">
<div class="caption">
<h3>{{mansion.address}}</h3>
<p><strong>Type: </strong>{{mansion.type}}</p>
<p><strong>Description: </strong>{{mansion.description}}</p>
<p><strong>Price: </strong>{{mansion.price | currency}}</p>
</div>
</div>
</div>
</div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.14.3/ui-bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.14.3/ui-bootstrap-tpls.min.js"></script>
<script src="app.js"></script>
<script src="scripts/mansionsController.js"></script>
<script src="scripts/mansionsFactory.js"></script>
</html>
Maybe you must change this 也许你必须改变这个
{{mansion.image}}
To: 至:
"+ {{mansion.image}} +"
Since it says {{mansion.image}} the actual jpg files have to be singular as well, mansion-1.jpg and not mansions-1.jpg. 由于显示的是{{mansion.image}},因此实际的jpg文件也必须是单数的,即mansion-1.jpg而不是mansions-1.jpg。 These details really get me. 这些细节真的让我知道。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.