We are currently working on a legacy project that needs to be maintained until the final version with angular-final is deployed.
Once we upgrade to the final version, I will be able to easily apply conditional Validators
using:
this.myForm.controls['name'].setValidators(Validators.required)
Previously, the set method was not available and the only exposed thing was:
validator: ValidatorFN;
property on AbstractControl
.
Based on this, I attempted to set it by just using:
this.myForm.controls['someControl'].validator(Validators.required)
However, this resulted in the following error being thrown:
"Cannot read property 'validationViolations' of undefined"