从标签分类进入,我会激活标签选项

This commit is contained in:
luchenqun 2017-02-03 17:40:44 +08:00
parent 1bb8a0c4a9
commit 093c659182
3 changed files with 8 additions and 4 deletions

View File

@ -18,9 +18,8 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', 'bookmarkService', 'p
});
$scope.getBookmarks = function(tagId, currentPage) {
console.log('tags getBookmarks', tagId);
$scope.bookmarkClicked = true;
$scope.currentTagId = tagId;
$scope.currentTagId = tagId;
$scope.tags.forEach(function(tag) {
tag.bookmarkClicked = false;
@ -91,5 +90,10 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', 'bookmarkService', 'p
bookmarkService.getTags(params)
.then((data) => $scope.tags = data)
.catch((err) => console.log('getTags err', err));
pubSubService.publish('Common.menuActive', {
login: true,
index: 1
});
}
}]);

View File

@ -3,7 +3,7 @@
<div class="ui grid">
<div class="two wide column" ng-class="" ng-mouseover="" ng-mouseleave="" ng-repeat="tag in tags">
<div class="ui small label" ng-class="{green:tag.bookmarkClicked}" ng-click="getBookmarks(tag.id, 1)">
{{ tag.name }} x {{ tag.cnt }}
{{ tag.name }} ({{ tag.cnt }})
</div>
</div>
</div>

View File

@ -265,7 +265,7 @@ api.get('/bookmarksByTag', function(req, res) {
})
sendData.totalItems = totalItems;
sendData.bookmarks = data;
res.json(sendData);
})
.catch((err) => console.log('bookmarks table or card err', err))