Brakebein / ngx-tagify

Angular library that wraps https://github.com/yaireo/tagify/
MIT License
26 stars 4 forks source link

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? #12

Closed NorhanSamir closed 2 years ago

Brakebein commented 2 years ago

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, use this.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 2 years ago

Thank you it works fine. this.form.setValue({ tags: [] }); I was trying to reset it using reset control This.formgroup.reset();