Improve this Doc View Source ngMinlength
- directive in module ng
Overview
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: -
ngMinlength
does not set theminlength
attribute and therefore HTML5 constraint validation is not available. - The
ngMinlength
value must be an expression, while theminlength
value must be interpolated.
Directive Info
- This directive executes at priority level 0.
Usage
- as attribute:
<ANY ng-minlength="expression"> ... </ANY>
Arguments
Param | Type | Details |
---|---|---|
ngMinlength | expression | AngularJS expression that must evaluate to a |
Example
© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.7.8/docs/api/ng/directive/ngMinlength