mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-21 21:51:48 +00:00
refactor tags directive(tags => tag-list, tag-item) & improve search UX
This commit is contained in:
16
src/directives/tag-item.js
Normal file
16
src/directives/tag-item.js
Normal file
@@ -0,0 +1,16 @@
|
||||
/* global angular */
|
||||
angular.module('codexen')
|
||||
.directive('tagItem', function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
template: '#<span ng-bind="tag.name"></span>',
|
||||
scope: {
|
||||
tag: '=tagItem'
|
||||
},
|
||||
link: function (scope, el) {
|
||||
el.on('click', function () {
|
||||
scope.$emit('tagSelected', scope.tag)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user