Issue
Currently I'm trying to create a dynamic validation in Angular Forms and I found this Question.
Adding the error to the field
this.form.get('field').setErrors({ 'invalid': true });
Removing the error to the field
this.form.get('field').setErrors(null);
My question is how can I remove a specific error in the field? Example I have multiple setErrors
and I only want to remove the invalid
error
Solution
I believe this should work:
this.form.get('field').setError({'invalid': null})
Answered By - Ana Weidner
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.