I have two inputs: - First one on which I apply my custom validator - Second one which value I use in my custom validator (it is dynamic and editable)
If I apply my cust
You can update the validity of a formControl
form.controls['myControl'].updateValueAndValidity();
I found this to be much better
this.myForm.markAllAsTouched();
If you have template-driven form you can access form throw ViewChild decorator:
@ViewChild('myForm') public form: NgForm;
then, validate one field or the whole form group using method mentioned above:
this.form.controls.myControl.updateValueAndValidity();