我想在AngularStrap模态
中进行无限滚动。
我还想修复模态页眉和模态页脚,并且只滚动模态体内的内容。我正在使用ngInfiniteScroll库。
问题是它显示了两个滚动条,而外条控制着无限滚动。
JS:
app.controller('DealCommentsCtrl', function ($scope, $location, callingDealData) {
if(!callingDealData.getDeal()){
$location.path('/deals');
}else{
$scope.comments = [];
for(var i=0;i<6;i++){
$scope.comments.push(COMMENTS[i]);
}
}
$scope.loadMore = function() {
var last = $scope.comments.length;
for(var i = last; i <= last + 6; i++) {
$scope.comments.push(COMMENTS[i]);
}
};
HTML:
<div class="modal mymodal" ng-controller="DealCommentsCtrl">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4>Comments</h4>
</div>
<div class="modal-body">
<div infinite-scroll='loadMore()' infinite-scroll-distance='2'>
<div ng-repeat="comment in comments">
{{comment.text}}<br/>
{{comment.userFullName}}
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="$hide();" class="btn btn-primary">Close</button>
</div>
</div>
</div>
</div>
这是一个plunker:http
://plnkr.co/edit/mE5EMEYV6Tx3S1VopKfW
但是滚动不起作用,因为主页没有滚动(我认为它涉及到同样的问题)
谢谢