切换备忘录分类当前页重置为

This commit is contained in:
luchenqun 2018-04-16 19:36:22 +08:00
parent 3cb2187254
commit a8e14c4755
1 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,6 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
$scope.changeCurrentPage = function (currentPage) { $scope.changeCurrentPage = function (currentPage) {
currentPage = parseInt(currentPage) || 0; currentPage = parseInt(currentPage) || 0;
console.log('currentPage = ', currentPage);
if (currentPage <= $scope.totalPages && currentPage >= 1) { if (currentPage <= $scope.totalPages && currentPage >= 1) {
$scope.currentPage = currentPage; $scope.currentPage = currentPage;
$scope.inputPage = ''; $scope.inputPage = '';
@ -262,6 +261,7 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
if ($scope.add || $scope.edit) { if ($scope.add || $scope.edit) {
} else { } else {
$scope.currentPage = 1;
getNotes($scope.currentTagId); getNotes($scope.currentTagId);
} }
} }
@ -317,8 +317,8 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
perPageItems: perPageItems, perPageItems: perPageItems,
searchWord: $scope.searchWord, searchWord: $scope.searchWord,
}; };
if (tagId) { if (tagId || $scope.currentTagId) {
params.tagId = tagId; params.tagId = tagId || $scope.currentTagId;
} }
bookmarkService.getNotes(params) bookmarkService.getNotes(params)
.then((data) => { .then((data) => {