Hi!
I’m trying to implement a reactive form with a formgroup of 2 elements and a validator to access the 2 elements simultaneously. How can this be achieved?
eg:
this.formBuilder.group({
var1: [’’, [Validators.required, customValidator]],
var2: [’’, [Validators.required, customValidator]]
});
The use case scenario is var1 must never be greater than var2 and var2 must never be less than var1.
Thank you.
2 posts - 2 participants