Is it possible to set as invalid form control in angular2? (used form builder)
eg. i have form-> exampleFrom & field-> exampleControl
I have tried this, not succeed :
this.exampleFrom.controls['exampleControl'].invalid
Try
let control = this.exampleFrom.controls['exampleControl'];
control.setErrors({backend: {someProp: "Backend message"}});
let message = control.errors['backend'].someProp;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With