I.m trying to remove all values from tagify using reactive form I reset all the form controls but the tagify tags are not deleted how can I delete them?
NorhanSamir opened this issue · 2 comments
NorhanSamir commented
I.m trying to remove all values from tagify using reactive form I reset all the form controls but the tagify tags are not deleted how can I delete them?
Brakebein commented
How are you trying to delete them? Can you share some code?
Please keep in mind that the component does not deep check for changes, and it also won't recognize changes in the array length. See README:
Note: The component only recognizes reference changes, it won't deep check for changes within the array.
this.tags.push({value: 'bar'});
won't do anything. Instead, usethis.tags = this.tags.concat([{value: 'bar'}]);
(or similar) to update changes.
To reset a reactive forms control value, just set an empty array:
this.form.setValue({
tags: []
});
NorhanSamir commented
Thank you it works fine.
this.form.setValue({
tags: []
});
I was trying to reset it using reset control
This.formgroup.reset();