I am attempting to use autocomplete inside ngTagsInput and I am getting the following errors:
Error: [ngRepeat:dupes] http://errors.angularjs.org/1.2.9/ngRepeat/dupes?p0=item%20in%20suggestionList.items%20track%20by%20track(item)&p1=undefined
at Error (native)
OR
TypeError: Cannot read property 'replace' of undefined
at j (https://localhost:3000/js/plugins/ng-tags-input.min.js:1:5556)
I have checked several time that my querying function is returning a proper array of tags, and it is. It works beautifully. The structure of a tag looks like:
{
name: String,
_id: ObjectId,
__v: Number,
active: Boolean,
display: Boolean,
createDate: Date
}
My html looks like:
<tags-input
ng-model="tags"
displayProperty="name"
placeholder="Add a tag">
<auto-complete source="loadTags($query)"></auto-complete>
</tags-input>
And my loadTags function is:
$scope.loadTags = function(query) {
return $http.get(configService.getApi() + '/tags?conditions=' + urlEncodeObject({name: { $regex: query }}), {
headers: {
'x-auth-token': sessionService.getToken()
}
});
};
displayProperty should have been display-property. Doh!
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