Adding code to re-validate on value change

This commit is contained in:
Robert
2019-01-15 10:17:26 +01:00
committed by GitHub
parent a809e35e5d
commit 9bc047c03f

View File

@@ -182,6 +182,9 @@
else {
vm.onValueChanged({ value: [] });
}
//this is required to re-validate
$scope.propertyForm.tagCount.$setViewValue($scope.model.value.length);
}
/**
@@ -189,7 +192,7 @@
*/
function validateMandatory() {
return {
isValid: !vm.validation.mandatory || (vm.viewModel != null && vm.viewModel.length > 0) || (vm.value != null && vm.value.length > 0),
isValid: !vm.validation.mandatory || (vm.viewModel != null && vm.viewModel.length > 0),
errorMsg: "Value cannot be empty",
errorKey: "required"
};