From 65d6f8616b0e3f9140a727702f7b280a442f4d16 Mon Sep 17 00:00:00 2001 From: Athou Date: Mon, 3 Mar 2014 13:15:37 +0100 Subject: [PATCH] fix tag removal --- src/main/webapp/js/directives.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/js/directives.js b/src/main/webapp/js/directives.js index cc5a012d..03a0d128 100644 --- a/src/main/webapp/js/directives.js +++ b/src/main/webapp/js/directives.js @@ -66,11 +66,14 @@ module.directive('tags', function() { }; $scope.$watch('entry.tags', function(newValue, oldValue) { - if (newValue && oldValue && newValue != oldValue) { + if (oldValue && newValue != oldValue) { var data = { entryId : $scope.entry.id, - tags : newValue.split(',') + tags : [] }; + if (newValue) { + data.tags = newValue.split(','); + } EntryService.tag(data); } }, true);