MCPcopy Create free account
hub / github.com/apache/cloudstack / maxLengthValidator

Function maxLengthValidator

tools/ngui/static/js/lib/angular.js:11606–11614  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

11604 if (attr.ngMaxlength) {
11605 var maxlength = int(attr.ngMaxlength);
11606 var maxLengthValidator = function(value) {
11607 if (!isEmpty(value) && value.length > maxlength) {
11608 ctrl.$setValidity('maxlength', false);
11609 return undefined;
11610 } else {
11611 ctrl.$setValidity('maxlength', true);
11612 return value;
11613 }
11614 };
11615
11616 ctrl.$parsers.push(maxLengthValidator);
11617 ctrl.$formatters.push(maxLengthValidator);

Callers

nothing calls this directly

Calls 1

isEmptyFunction · 0.85

Tested by

no test coverage detected