Display an error if the input value is shorter than five characters:
<input name="myInput" ng-model="myInput" ng-minlength="5">
<h1 ng-if="!myForm.myInput.$valid">The value is too short</h1>
Definition and Usage
ng-minlength directive adds a restriction to an input field,
and to the validator of the form.
ng-minlength directive will add an "invalid" state of the
input field if the length of the value is less than specified.
Note: If the value is empty, it is considered valid.
Mainly supported by <input> elements of type text, but can also be used on other elements that allows user input.
|number||A number representing the minimum number of characters legal for the input field.|