AngularJS enriches form filling and validation. AngularJS provides client-side form validation. It checks the state of the form and input fields (input, text-area, select), and notify the user about the current state. It also holds the information about whether the input fields have been touched, or modified, or not.
There are following directives that can be used to track error:
- $dirty
It states that the value has been changed. - $invalid
It states that the value which is entered is invalid. - $error
It states the exact error.
Moreover, we can use novalidate with a form declaration to disable the browser’s native form validation.