ngTagsInput is a great tags input directive for Angularjs. It auto suggests tags from an external source and populates them into an input for form submission. While using it, I discovered that having multiple instances on a form caused an angularjs error.
Error: [ngRepeat:dupes] Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: tag in tagList.items track by track(tag), Duplicate key
If you experience this error, search and find the following.
tag in tagList.items track by track(tag)
item in suggestionList.items track by track(item)
Replace it with the code below.
tag in tagList.items track by $index
This allows Angular to keep track of the items in the repeat.
item in suggestionList.items track by $index
After nearly the entire day of searching for duplicate data, your article solved my bug.
Thanks very much.
Thanks for leaving a comment. Glad to hear that it helped.