Angular
Intro to Reactive Forms in Angular - Validate Forms

Exercise: Cross-field Validation

Mute
Current Time 0:00
/
Duration Time 0:00
Loaded: 0%
Progress: 0%
Stream TypeLIVE
Remaining Time -0:00
 
PRO

In this exercise what I'd like you to do is:
1. Under phoneValidator, define a new custom cross-field validator called dateValidator.
-- Get both startDate and endDate from the passed in control.
-- Return an error called invalidDates if startDate > endDate
-- Otherwise, return null
2. Add dateValidator to the dateRange FormGroup

Exercise Link: https://stackblitz.com/fork/rxngforms-validation-ex4

 

I finished! On to the next chapter