$http({
url:"http://59.110.139.104:3000/wy?myUrl="+$scope.url,
metheod:"GET"
})
.then(function (res) {
console.log(res);
$scope.data = res.data.top_stories;
console.log($scope.data);
})
.then(function (error) {
if(error){
console.log(error.message);
}
});
以上是网络请求后得到的图片对象,data:[Object, Object, Object, Object, Object]
,地址:[data[0].image],[data[1].image]
[data[2..].image]
,,,
用下面的方法监听一下
$scope.$watch("data" , function (newValue , oldValue) {
if(newValue && newValue.length > 1){
$ionicSlideBoxDelegate.update();
$ionicSlideBoxDelegate.loop(true);
}
})