简体   繁体   中英

ng tags input not allowing same text twice to be entered in the text box

I am using ng-tags input for autocomplete if the autocomplete bring result of same text , for eg: two results being populated when I type "R", "Rob","Rob" like this.

I have clicked one "Rob" its is in the text box now but when I type again "R" "Rob" is not coming. How to provide the uniqueness for each item in the list.

Tags are unique by default by their text property (here "Rob"). You can change that with the "keyProperty" attribute, setting it to Rob's unique identifier.

<tags-input
    ng-model="users"
    key-property="_id"
    display-property="username">
 </tags-input>

http://mbenford.github.io/ngTagsInput/documentation/api

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM