fix tag removal

This commit is contained in:
Athou
2014-03-03 13:15:37 +01:00
parent 5c27f0834c
commit 65d6f8616b

View File

@@ -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);