Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $scope.Tags = [{id:1, name:'tag1', desc:'desc1'}, {id:2, name:'tag2', desc:'desc2'}, {id:3, name:'tag3', desc:'desc1'}, ...];
- <ul>
- <li ng-repeat="T in Tags">{{ T.name }}</li>
- </ul>
- <ul>
- <li
- ng-repeat="T in Tags"
- ng-click="removeTag($event);"
- >{{ T.name }}</li>
- </ul>
- $scope.removeTag = function (event) {
- // the following code is just used to remove the Tag from the list
- // using underscore.js
- $scope.Tags = _($scope.Tags).filter(function (t) {
- return t.name !== event.srcElement.innerHTML
- });
- }
- <ul>
- <li ng-repeat="T in Tags" ng-click="Tags - T">{{ T.name }}</li>
- <!-- this is more like a dream tho -->
- </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement