Solution: Dynamic Validation
Execute a possible implementation of the dynamic validation assignment.
We'll cover the following...
We'll cover the following...
Let's divide the solution code into blocks and describe each of them individually.
The form model
We start by creating an interface for the form model:
The RegistrationForm interface contains the fields needed for the form, allowing the use of strong types.
Template
The template doesn't contain much logic in this exercise.
For the template, the most important part of the assignment is to define the validation errors. We need to list all possible errors for the address field as we assigned different validation rules to the same control.
The component class
The component class contains all the validation logic. It's also possible to achieve the same result using custom validators, but the ...