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();
}
Extract the control from the form, and call reset on it with ''.
clear(): void {
this.form.get('value')?.reset('');
this.applyFitler();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With