Make tag-input support dirty handling on tag deletion
This commit is contained in:
@@ -581,7 +581,8 @@ app.directive('tagInput', function () {
|
||||
scope: {
|
||||
inputTags: '=taglist'
|
||||
},
|
||||
link: function ($scope, element, attrs) {
|
||||
require: '^form',
|
||||
link: function ($scope, element, attrs, formCtrl) {
|
||||
$scope.defaultWidth = 200;
|
||||
$scope.tagText = ''; // current tag being edited
|
||||
$scope.placeholder = attrs.placeholder;
|
||||
@@ -613,6 +614,7 @@ app.directive('tagInput', function () {
|
||||
tagArray.splice(key, 1);
|
||||
}
|
||||
}
|
||||
formCtrl.$setDirty();
|
||||
return $scope.inputTags = tagArray.join(',');
|
||||
};
|
||||
$scope.$watch('tagText', function (newVal, oldVal) {
|
||||
|
||||
Reference in New Issue
Block a user