In an Angular 4 application, I have a form model as follows:
this.form = this._fb.group({
title: ['', [Validators.required, Validators.minLength(3), Validators.maxLength(50)]],
description: ['', [Validators.required, Validators.minLength(3)]]
});
Now I want to dynamically remove only the required validator from the ruler check array. Something like that:
saveDraft() {
this.form.controls['title'].removeValidator('required');
}
This question is not a duplicate of the question. My business is different. I just want to remove the necessary validator, unknowingly, others.
source
share