从标签分类进入,我会激活标签选项
This commit is contained in:
parent
1bb8a0c4a9
commit
093c659182
|
|
@ -18,9 +18,8 @@ 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;
|
||||||
|
|
||||||
$scope.tags.forEach(function(tag) {
|
$scope.tags.forEach(function(tag) {
|
||||||
tag.bookmarkClicked = false;
|
tag.bookmarkClicked = false;
|
||||||
|
|
@ -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
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -265,7 +265,7 @@ api.get('/bookmarksByTag', function(req, res) {
|
||||||
})
|
})
|
||||||
sendData.totalItems = totalItems;
|
sendData.totalItems = totalItems;
|
||||||
sendData.bookmarks = data;
|
sendData.bookmarks = data;
|
||||||
|
|
||||||
res.json(sendData);
|
res.json(sendData);
|
||||||
})
|
})
|
||||||
.catch((err) => console.log('bookmarks table or card err', err))
|
.catch((err) => console.log('bookmarks table or card err', err))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue