Dave de Moel
10/29/2021, 6:46 AM(function () {
"use strict";
angular.module("umbraco")
.directive("nameValidator", nameValidator);
function nameValidator() {
console.log("Hello from validator");
return {
require: "ngModel",
link: function (scope, elm, attrs, ctrl) {
ctrl.$validators.nameValidator = function (modelValue, viewValue) {
if (ctrl.$isEmpty(modelValue)) {
return true;
}
if (viewValue.indexOf(B) === -1) {
return false;
}
};
}
}
}
})();
The console.log is never called 😦