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

Function minlengthDirective

lib/test/angular/1.7.0/angular.js:34921–34938  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34919 * </example>
34920 */
34921var minlengthDirective = function() {
34922 return {
34923 restrict: 'A',
34924 require: '?ngModel',
34925 link: function(scope, elm, attr, ctrl) {
34926 if (!ctrl) return;
34927
34928 var minlength = 0;
34929 attr.$observe('minlength', function(value) {
34930 minlength = toInt(value) || 0;
34931 ctrl.$validate();
34932 });
34933 ctrl.$validators.minlength = function(modelValue, viewValue) {
34934 return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;
34935 };
34936 }
34937 };
34938};
34939
34940if (window.angular.bootstrap) {
34941 // 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