Reputation: 281
I'm trying to set a form control status to invalid, but this example doesn't work
this.currencyForm.controls['currencyMaxSell'].setErrors({smallerThan: true})
Upvotes: 3
Views: 10211
Reputation: 3218
I don't know why would anyone like to set formControl as invalid witout a validator but here's how you do this this.myForm.controls['mycontrolname'].setErrors({});
.
You should use validators and set control invalid this way
Upvotes: 2