0
ng-change 레이블로 함수를 호출 할 수 없습니다. 페이지 매김은 지금까지 모든 달력 주를 나열해야하며 (38), 선택한 달력 주를 pageChanged에 나열해야합니다. 나는 getData 함수에서 $scope.currentPage
을 호출하여 변경시주의 사항을 업데이트하는 방법을 알아야한다.AngularJS 함수에 대한 uib 페이지 매김 변경 -
<uib-pagination
total-items="totalItems"
ng-model="currentPage"
max-size="maxSize"
boundary-link-numbers="true"
ng-change="pageChanged()"></uib-pagination>
$scope.pageChanged = function() {
getData();
};
$scope.totalItems = 7;
$scope.currentPage = 1;
$scope.maxSize = 38;
function getData() {
$http.get($auth.apiUrl() + '/api/status?cweek=' + $scope.currentPage).then(function(response) {
$scope.getData = response.data;
},
function(error) {
alert("Could not fetch data from /api/status");
});
}