If you are pulling from a source of
[{text: 'a'}, {text: 'ab'}, {text: 'abc'}]
and user enters in 'abcd', how do you prevent user from creating an 'abcd' tag?
Just set the addFromAutocompleteOnly
to true
and only suggestions coming from the autocomplete popup will be allowed to be added as tags.
<tags-input ng-model="tags" add-from-autocomplete-only="true">
<auto-complete source="loadTags($query)"></auto-complete>
</tags-input>
Plunker
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