MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / minlengthDirective

Function minlengthDirective

lib/test/angular/1.4.3/angular.js:28327–28344  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28325};
28326
28327var minlengthDirective = function() {
28328 return {
28329 restrict: 'A',
28330 require: '?ngModel',
28331 link: function(scope, elm, attr, ctrl) {
28332 if (!ctrl) return;
28333
28334 var minlength = 0;
28335 attr.$observe('minlength', function(value) {
28336 minlength = toInt(value) || 0;
28337 ctrl.$validate();
28338 });
28339 ctrl.$validators.minlength = function(modelValue, viewValue) {
28340 return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;
28341 };
28342 }
28343 };
28344};
28345
28346 if (window.angular.bootstrap) {
28347 //AngularJS is already loaded, so we can return here...

Callers

nothing calls this directly

Calls 1

toIntFunction · 0.70

Tested by

no test coverage detected