Issue
How to cancel validation in onValueChanged function in angular?
When I finish the form, I change the device value. You can see that a validation will be trigger in the apple phone. However, I set the validation in the field touched. I don't want to show this message while I click the device (onValueChanged function). It trigger the "touched" validation. Any one can help?
Solution
Why not change the form control to pristine and untouched. Then form validations will not show.
  deviceListOnChange(e) {
    this.updateForm.controls.apple.setValue(null);
    this.updateForm.controls.apple.markAsPristine();
    this.updateForm.controls.apple.markAsUntouched();
  }
                            Answered By - Naren Murali
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.