Example for on-tag-adding function
vimal7370 opened this issue · 0 comments
vimal7370 commented
I can't seem to get the chaining correct.
A part of, or the whole code below I am using is incorrect. Is it possible for someone to share a simple working on-tag-adding function?
I am trying to post to a URL, and based on the response code, I want the tag to be added or removed from < tags-input >
$http.post( ... ).then(function(res) {
if (res.status == 204) {
return $q.when(true);
} else {
return $q.reject(false);
}
}, function(err) {
return $q.reject(false);
}).then(function(a) { return $q.reject(a); });
Thank you!