Improve this Doc View Source ngMinlength

From Get docs
< Directive components in ngAngularjs/docs/1.8/api/ng/directive/ngminlength

Improve this Doc View Source ngMinlength

  1. directive in module ng


ngMinlength adds the minlength validator to ngModel. It is most often used for text-based input controls, but can also be applied to custom text-based controls.

The validator sets the minlength error key if the ngModel.$viewValue is shorter than the integer obtained by evaluating the AngularJS expression given in the ngMinlength attribute value.

Note: This directive is also added when the plain minlength attribute is used, with two differences:

  1. ngMinlength does not set the minlength attribute and therefore HTML5 constraint validation is not available.
  2. The ngMinlength value must be an expression, while the minlength value must be interpolated.

Directive Info

  • This directive executes at priority level 0.


  • as attribute:



Param Type Details
ngMinlength expression AngularJS expression that must evaluate to a Number or String parsable into a Number. Used as value for the minlength validator.


© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 3.0.