Solution: Cross-reference Validation
Explore a possible solution for the previous cross-reference validation exercise.
We'll cover the following...
Let us break down the solution into its sub-parts.
The Component
class
The exercise requirements asked us to make all form fields mandatory. For this, we could use the built-in validator, Validators.required
(lines 22–24). Moreover, since we need to validate the value of two different form fields, we assign a custom validator to the FormGroup
property, allowing us to ...