diff --git a/public/scripts/controllers/note-controller.js b/public/scripts/controllers/note-controller.js index b5da23b..50641f1 100644 --- a/public/scripts/controllers/note-controller.js +++ b/public/scripts/controllers/note-controller.js @@ -13,6 +13,8 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind $scope.totalPages = 0; $scope.currentPage = 1; $scope.inputPage = ''; + $scope.searchWord = $stateParams.searchWord + $scope.totalItems = 0; var timeagoInstance = timeago(); @@ -188,12 +190,13 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind var params = { currentPage: $scope.currentPage, perPageItems: perPageItems, - searchWord: $stateParams.searchWord, + searchWord: $scope.searchWord, }; bookmarkService.getNotes(params) .then((data) => { $scope.notes = data.notes; $scope.totalPages = Math.ceil(data.totalItems / perPageItems); + $scope.totalItems = data.totalItems; $timeout(function() { timeagoInstance.cancel(); timeagoInstance.render(document.querySelectorAll('.need_to_be_rendered'), 'zh_CN'); diff --git a/public/views/note.html b/public/views/note.html index 0e5d9c5..816470b 100644 --- a/public/views/note.html +++ b/public/views/note.html @@ -44,7 +44,7 @@
-
共找到备忘一共约{{notes.length}}个
+
通过搜索关键字"{{searchWord}}",共找到备忘一共约{{totalItems}}个