Skip to content

Commit d6c43a7

Browse files
committed
Update paginator
1 parent 136f497 commit d6c43a7

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

AutoBlockList/wwwroot/backoffice/autoBlockList/overview.controller.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,30 @@ angular.module("umbraco").controller("autoBlockList.overview.controller", functi
3131
vm.selectedContent = [];
3232
};
3333

34-
$http.get("/umbraco/backoffice/api/AutoBlockListApi/GetAllContentWithNC").then(function (response) {
34+
$http.get("/umbraco/backoffice/api/AutoBlockListApi/GetAllContentWithNC?page=0").then(function (response) {
3535
vm.loading = false;
3636

3737
vm.pagedContent = response.data;
3838

39-
console.log(vm.pagedContent)
40-
41-
vm.page = 1;
42-
vm.totalPages = Math.ceil(vm.content.length / 10);
43-
44-
vm.filteredContent = vm.content.slice(0, 10)
4539
});
4640

4741
vm.paginator = function (page) {
48-
vm.filteredContent = vm.content.slice((page - 1) * 10, (page - 1) * 10 + 10)
42+
$http.get("/umbraco/backoffice/api/AutoBlockListApi/GetAllContentWithNC?page=" + page).then(function (response) {
43+
vm.pagedContent = response.data;
44+
45+
});
4946
}
5047

5148
vm.nextPage = function () {
52-
vm.paginator(vm.page += 1);
49+
vm.paginator(vm.pagedContent.pageNumber += 1);
5350
}
5451

5552
vm.prevPage = function () {
56-
vm.paginator(vm.page -= 1);
53+
vm.paginator(vm.pagedContent.pageNumber);
5754
}
5855

5956
vm.goToPage = function (pageNumber) {
60-
vm.paginator(vm.page = pageNumber);
57+
vm.paginator(pageNumber);
6158
}
6259

6360
vm.convertContent = function (content) {

0 commit comments

Comments
 (0)