Form and controls provide validation services, so that the user can be notified of invalid input before submitting a form. This provides a better user experience than server-side validation alone because the user gets instant feedback on how to correct the error.
Angular provides basic implementation for most common HTML5 input types: (text, number, url, email, date, radio, checkbox),
as well as some directives for validation (required, pattern, minlength, maxlength,
min, max).
| Method | Description |
|---|---|
| required | To validate that a form input has been filled out |
| ng-minlength | Makes the element require a given minimum length. |
| ng-maxlength | Makes the element require a given maxmimum length. |
| ng-pattern | To ensure that an input matches a regex pattern |
| type="email" | Makes the element require a valid email |
| type="url" | Makes the element require a valid url |
| type="number" | Makes the element require a decimal number. |