Custom Validation
In this lesson, we will learn about validating our forms and creating custom validation for complex use cases. We will also look at the best way to use reactive forms with validation.
We'll cover the following...
Now each of these has its own advantage over one another, and it is totally up to the developer to choose based on their requirements.
One of the many reasons you would choose to work with model-driven forms is to make it easier to unit test and use up other great features of reactive forms, like Custom validation
. You can do most of the work from the component class and only put the instances of the input fields on the template.
In this lesson, we will look at how to make the best use of these forms using Custom Validation provided by Angular’s reactive forms.
Validation
Users like it when forms are interactive, i.e., they let them know if there is anything wrong that they are doing. To get the best results out of a form, you need to ensure that the users’ inputs are validated, and ...