Javascript 在引导corousel中显示9项,重复ng
总共20张图片,我必须在每个滑块中显示9个项目,所以总共有3个滑块 我尝试了以下链接Javascript 在引导corousel中显示9项,重复ng,javascript,jquery,html,angularjs,bootstrap-carousel,Javascript,Jquery,Html,Angularjs,Bootstrap Carousel,总共20张图片,我必须在每个滑块中显示9个项目,所以总共有3个滑块 我尝试了以下链接 {{$index+1}} {{$index+1+9} {{$index+1+18} 但是图像计数将是动态的,所以如果我有50个图像意味着我必须写6次。如何根据图像计数动态执行此操作。在控制器中切片注释.images数组,以便获得数组数组,然后使用两个嵌套的ng repeat循环。好的,我将尝试此解决方案仅从ejs文件中获取注释.images,然后如何才能拼接?你能给我举个例子吗 <div class
{{$index+1}}
{{$index+1+9}
{{$index+1+18}
但是图像计数将是动态的,所以如果我有50个图像意味着我必须写6次。如何根据图像计数动态执行此操作。在控制器中切片
注释.images
数组,以便获得数组数组,然后使用两个嵌套的ng repeat
循环。好的,我将尝试此解决方案仅从ejs文件中获取注释.images,然后如何才能拼接?你能给我举个例子吗
<div class='greybg' ng-repeat="comment in location.comments">
<div class="row">
<div id="myCarousel{{location.comments[0]._id}}" class="carousel slide" data-ride="carousel">
<div class="carousel-inner multiple_pictures" >
<div class="item" ng-class="{active:!$index}">
<div class="row" >
<div class="col-sm-4" ng-repeat="images in comment.images.slice(0,9)">
<img ng-src={{images.path}} alt="First slide"> <div class="gplabel">{{$index+1}}</div>
</div>
</div>
</div>
<div class="item">
<div class="row">
<div class="col-sm-4" ng-repeat="images in comment.images.slice(9,18)">
<img ng-src={{images.path}} alt="First slide"> <div class="gplabel">{{$index+1+9}}</div>
</div>
</div>
</div>
<div class="item">
<div class="row">
<div class="col-sm-4" ng-repeat="images in comment.images.slice(18,27)">
<img ng-src={{images.path}} alt="First slide"> <div class="gplabel">{{$index+1+18}}</div>
</div>
</div>
</div>
<a ng-if="comment.images.length>1" class="left carousel-control" href="#myCarousel{{location.comments[0]._id}}" role="button"
data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a ng-if="comment.images.length>1" class="right carousel-control" href="#myCarousel{{location.comments[0]._id}}" role="button"
data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div></div></div>