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

Function minlengthDirective

test/angular/1.6/angular.js:34698–34715  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34696 * </example>
34697 */
34698var minlengthDirective = function() {
34699 return {
34700 restrict: 'A',
34701 require: '?ngModel',
34702 link: function(scope, elm, attr, ctrl) {
34703 if (!ctrl) return;
34704
34705 var minlength = 0;
34706 attr.$observe('minlength', function(value) {
34707 minlength = toInt(value) || 0;
34708 ctrl.$validate();
34709 });
34710 ctrl.$validators.minlength = function(modelValue, viewValue) {
34711 return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;
34712 };
34713 }
34714 };
34715};
34716
34717if (window.angular.bootstrap) {
34718 // 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