Make Multi URL Picker mandatory validation work clientside

This commit is contained in:
Kenn Jacobsen
2019-09-06 20:53:00 +02:00
committed by Sebastiaan Janssen
parent 5b949cef3c
commit 7507345c93

View File

@@ -134,6 +134,12 @@ function multiUrlPickerController($scope, angularHelper, localizationService, en
.then(function (data) {
vm.labels.general_recycleBin = data[0];
});
// if the property is mandatory, set the minCount config to 1 (unless of course it is set to something already),
// that way the minCount/maxCount validation handles the mandatory as well
if ($scope.model.validation && $scope.model.validation.mandatory && !$scope.model.config.minNumber) {
$scope.model.config.minNumber = 1;
}
}
init();