我希望能够从文件夹中提取图像并将其放入旋转木马中。到目前为止,我的角度控制器中有以下内容。
var carousel = angular.module('revampApp', []);
carousel.controller('carouselController', function($scope, $http){
$http.get('../Images/carousel/').success(function(images){
//Images
$scope.images = images;
})
});
在我的HTML身体中,我有这个:
<div class="img-carousel carousel slide" data-ride="carousel">
<div class="carousel-inner" ng-Controller="carouselController">
<div class="item" ng-repeat="image in images">
<img alt="First slide" data-ng-src="{{image.images}}">
</div>
</div>
<a class="left carousel-control" href=".img-carousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href=".img-carousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
但是,我在控制台中一直收到错误:“错误:[ng:areq] http://errors.angularjs.org/1.2.22/ng/areq?p0=CarouselController&p1=not%20a%20function%2C%20got%20undefined”但我无法弄清楚它是做错了什么。有人可以指出我正确的方向吗?