Issue
How to reset not the whole form, but only one field? And so that when the field is reset, it gets the value '', not null
clear(): void {
this.form.value.search = '';
// this.form.reset();
this.applyFilter();
}
Solution
Extract the control from the form, and call reset on it with ''.
clear(): void {
this.form.get('value')?.reset('');
this.applyFitler();
}
Answered By - Kanishk Anand
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.