在标签里面能进行删除编辑,标签上限为30

This commit is contained in:
luchenqun 2017-02-05 10:33:09 +08:00
parent 0ea5887444
commit 1c77706722
3 changed files with 6 additions and 3 deletions

View File

@ -98,7 +98,6 @@ app.controller('bookmarksCtr', ['$scope', '$state', '$stateParams', '$filter', '
}
} else {
$scope.bookmarks = data;
data.forEach((item) => console.log(item.name, item.click));
if ($scope.bookmarks.length == 0) {
toastr.info('您还没有书签,请点击菜单栏的添加按钮进行添加', "提示");
}

View File

@ -41,6 +41,11 @@ app.controller('editCtr', ['$scope', '$state', '$timeout', 'bookmarkService', 'p
}
});
if (tags.length + $scope.tags.length >= 30) {
toastr.error('标签个数总数不能超过30个', "提示");
return;
}
bookmarkService.addTags(params)
.then((data) => {
$scope.tags = data;

View File

@ -21,6 +21,7 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', 'book
$scope.getBookmarks = function(tagId, currentPage) {
$scope.bookmarkClicked = true;
$scope.currentTagId = tagId;
$scope.currentPage = currentPage;
$scope.loadBookmarks = true;
$scope.tags.forEach(function(tag) {
@ -76,8 +77,6 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', '$stateParams', 'book
}
$scope.delBookmark = function(bookmarkId) {
toastr.warning('功能暂未实现。。。', "警告");
return;
var params = {
id: bookmarkId
}