How to manually set the error in form field in Angular?

Forums AngularHow to manually set the error in form field in Angular?
Staff asked 2 years ago

Answers (1)

Add Answer
Shahjaha Shaikh Marked As Accepted
Staff answered 2 years ago

You can set the error on the field by writing this code.

formName.controls[controlName].setErrors({'incorrect': true});

 

Subscribe

Select Categories