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

Function minlengthDirective

test/angular/1.3/angular.js:26414–26431  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26412};
26413
26414var minlengthDirective = function() {
26415 return {
26416 restrict: 'A',
26417 require: '?ngModel',
26418 link: function(scope, elm, attr, ctrl) {
26419 if (!ctrl) return;
26420
26421 var minlength = 0;
26422 attr.$observe('minlength', function(value) {
26423 minlength = int(value) || 0;
26424 ctrl.$validate();
26425 });
26426 ctrl.$validators.minlength = function(modelValue, viewValue) {
26427 return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;
26428 };
26429 }
26430 };
26431};
26432
26433 if (window.angular.bootstrap) {
26434 //AngularJS is already loaded, so we can return here...

Callers

nothing calls this directly

Calls 1

intFunction · 0.70

Tested by

no test coverage detected