在按日期排序的页面上打印10页。 假设总共有14个数据,则应该在第1页上输出No.14-No.5,在第2页上输出No.4-No.1。
但是,No.10-No.1在1页上输出,No.14-No.11在2页上输出。 我们该如何解决?
<div>
<dl ng-repeat="boardList in boardLists.content | orderBy:date: 'yyyy-MM-dd HH:mm:ss'">
<dt>
<a ng-if="boardList.captureImage" ng-click="boardDetail(boardList)"></a>
<span ng-click="boardDetail(boardList)"><i class="glyphicon glyphicon-ban-circle"></i>NO IMG</span>
</dt>
<dd>
<strong>
<a ng-click="boardDetail(boardList)">{{boardList.title}}</a>
<button class="btn btn-warning btn-xs" ng-if="boardList.user.id == userId" ng-click="boardDelete(boardList.id)">delete</button>
</strong>
<p><strong>{{boardList.user.alias}}</strong> {{boardList.updateDate | date: 'yyyy-MM-dd HH:mm:ss'}}</p>
<p class="dotContainer">{{boardList.description}}</p>
</dd>
</dl>
</div>
<div class="paginationContainer">
<pagination total-items="boardTotalElements" ng-model="list.currentPage" max-size="10" ng-change="callBoardList()" class="pagination-sm" previous-text="‹" next-text="›">
</pagination>
</div>
控制器的callBoardList。
$scope.callBoardList = function() {
$scope.userId = $rootScope.user.id;
$scope.title = "";
$scope.boardContents = "";
board.boardList({
page: $scope.list.currentPage - 1,
size: 10,
notice: {
boardType: $scope.boardLocationType.value,
searchType: $scope.searchType.value,
searchWord: $scope.searchWord
}
}).$promise.then(function(response) {
$scope.boardLists = response;
$scope.boardTotalElements = response.totalElements;
});
};