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

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,7 +18,6 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', 'bookmarkService', 'p
}); });
$scope.getBookmarks = function(tagId, currentPage) { $scope.getBookmarks = function(tagId, currentPage) {
console.log('tags getBookmarks', tagId);
$scope.bookmarkClicked = true; $scope.bookmarkClicked = true;
$scope.currentTagId = tagId; $scope.currentTagId = tagId;
@ -91,5 +90,10 @@ app.controller('tagsCtr', ['$scope', '$filter', '$window', 'bookmarkService', 'p
bookmarkService.getTags(params) bookmarkService.getTags(params)
.then((data) => $scope.tags = data) .then((data) => $scope.tags = data)
.catch((err) => console.log('getTags err', err)); .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="ui grid">
<div class="two wide column" ng-class="" ng-mouseover="" ng-mouseleave="" ng-repeat="tag in tags"> <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)"> <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> </div>
</div> </div>