我正在尝试使用owl-carousel传送带有angularjs的传送带。我希望我的传送带滚动无尽,每当列表完全滚动时加载项目并将查询的元素添加到实际列表中。我的问题是:AngularJS和猫头鹰传送带环境中的数组串联
当我从下一页的控制器获取数据时,我想要合并并联系接收到的项目以合并当前数组并将其呈现在旋转木马的末端,这里是我已经做了:
<data-owl-carousel class="owl-carousel" data-options="{navigation: true, pagination: false, rewindNav : false}">
<div owl-carousel-item="" ng-repeat="item in hmc.ProductData.Products track by $index" class="item">
<a ng-href="/#!//{{Page.Culture+'/product/'+item.id}}">
<div class="telewebion-show-box one-row">
<div class="telewebion-show-box-cover">
<ul>
<li>{{::item.title}}</li>
<li>{{::item.price}}</li>
</ul>
</div>
<img ng-src="{{::item.picture_path}}" width="220" height="148" alt="" class="img-responsive"/>
</div>
</a>
</div>
</data-owl-carousel>
这里是我的控制器:
hmc.getProducts=function(){
ProductFactory.getProducts(hmc.ProductData.Offset,hmc.ProductData.Limit).then(function(Products){
if(hmc.ProductData.Page==0)
{
hmc.ProductData.Products[0]='';
}
hmc.ProductData.Page++;
var tempArray=[];
tempArray.push(Products);
console.log(tempArray);
hmc.ProductData.Products [0]=hmc.ProductData.Products [0].concat(tempArray[0]);
console.log(hmc.ProductData.Products);
hmc.ProductData.UpdateInProgress=false;
});
}
,但不接触并合并阵列是行不通的。