I'm trying to write a custom validator for 2 text boxes, with some conditions.
Please see the code I wrote in Stackblitz Link to validate the text boxes with some conditions
Kindly help me where did I go wrong.
I'm trying to write a custom validator for 2 text boxes, with some conditions.
Please see the code I wrote in Stackblitz Link to validate the text boxes with some conditions
Kindly help me where did I go wrong.
Copyright © 2021 Jogjafile Inc.
You can add that in
textbox1andtextBox2controls validatorsNow remove the validator from the
formGroup,Validators.patternwill make sure to apply validation on both the field.Now add
errors.patterninside*ngIfcondition to see whether that pattern matched or not.Updated Stackblitz