NgTagsInput - allow selection of autocomplete suggestions?

If you pull from the source

[{text: 'a'}, {text: 'ab'}, {text: 'abc'}]

and the user enters 'abcd', how do you prevent the user from creating the 'abcd' tag?

+4
source share
1 answer

Just set addFromAutocompleteOnlyto true, and only offers coming from the pop-up auto-complete window will be added as tags.

<tags-input ng-model="tags" add-from-autocomplete-only="true">
  <auto-complete source="loadTags($query)"></auto-complete>
</tags-input>

Plunker

+11
source

Source: https://habr.com/ru/post/1627234/


All Articles