Allowing users to input data into forms also allows users to input mistakes into the data. Validation is the process of checking whether any input data meets our application's expectations. In Angular, we use ngModel and its relationship to our input data-binding to inspect the state of our data and tell us whether it is valid.
Validating data with Angular form properties
Getting Ready
Let's add a title length validation to our blog post's title field. We don't want to allow any title shorter than 5 characters, or longer than 140 (we have to keep it tweet-able). We will also surface this error to our users when the title field is invalid and show them a warning with an explanation of what is wrong.
...