我尝试了如何从此链接http://blog.hfarazm.com/angularjs-routeparams/
实现此代码但是我的滑块显示图片有问题
这是我的控制器
.controller('HomeController',['dataProvider','$scope','$location', '$modal', '$log', 'authService', '$http',
function(dataProvider, $scope, $location,$modal, $log, authService, $http){
$http.get('/data/data-slider.json').success (function(data){
$scope.imagesliderVariable = data;
$scope.orderGuitar = 'price';
});
}]);
我的观点
<carousel>
<slide ng-repeat="slide in imagesliderVariable" active="slide.active" index="$index">
<img ng-src="/uploads/home/{{slide.image}}.jpg" style="margin:auto;">
<div class="carousel-caption">
<h4>Slide </h4>
<p></p>
</div>
</slide>
</carousel>
在提示我的应用没有显示错误但图片无法显示,那么我的问题代码是什么?以前我说谢谢你提前。
答案 0 :(得分:0)
尝试使用then
:
.controller('HomeController',['dataProvider','$scope','$location', '$modal', '$log', 'authService', '$http',
function(dataProvider, $scope, $location,$modal, $log, authService, $http){
$scope.imagesliderVariable = [];
$http.get('/data/data-slider.json').then(function(data){
$scope.imagesliderVariable = data;
$scope.orderGuitar = 'price';
});
}]);