我是 Ionic 的新手。我正在使用 Ionic 框架 (1.3.20)、Angular JS、Cordova 5.0.0
模板文件browse.html 代码:
<div class="col-50"><img ng-src="{{availableImages[currentImage].src}}" /></div>
app.js代码:
.state('app.browse', {
url: "/browse",
views: {
'menuContent': {
templateUrl: "templates/browse.html",
controller: 'Ctrl'
}
}
})
控制器.js 代码
.controller('Ctrl',function($scope) {
$scope.currentImage = 0;
$scope.availableImages = [
{
src: "http://lorempixel.com/160/160/people/3"
}
];
console.log("reading image in controller !!!");
})
标题详细信息:
Request URL:http://lorempixel.com/160/160/people/3
Request Method:GET
Status Code:404 Not Found (from cache)
Response Headers
Client-Via:shouldInterceptRequest
Request Headers
Provisional headers are shown
Accept:image/webp,*/*;q=0.8
User-Agent:Mozilla/5.0 (Linux; Android 5.0.2; XT1033 Build/LXB22.46-28; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/42.0.2311.129 Mobile Safari/537.36
config.xml文件:
<access origin="*"/>
控制台错误:
GET http://lorempixel.com/160/160/people/3 404 (Not Found)
我验证了 url http://lorempixel.com/160/160/people/3在我的移动浏览器中显示图像。但图像没有出现在应用程序上。