Reputation: 848
I am trying to create a time picker component that binds to a reactive form control. I want the form control to be invalid if the end time is before the start time. I am aware of the built in validators that Angular comes with, but I want to be able to validate against another form control. If someone could point me in the right direction that would be great.
Upvotes: 3
Views: 873
Reputation: 97381
This is the approach I take:
FormGroup
containing the two controls.FormGroup
object that is passed in to retrieve the values of the two FormControl
objects and perform the validation.Upvotes: 3