mgicrush
mgicrush

Reputation: 53

ngTagsInput: How to show all results in autocompete?

I'm using ngTagsInput and this is my markup:

<tags-input add-from-autocomplete-only="true" 
            input-tabindex="4" 
            min-length="0" 
            ng-model="news.tags" 
            display-property="tagName" 
            replace-spaces-with-dashes="false" placeholder="Add tag">
  <auto-complete load-on-focus="true" 
                 load-on-empty="true" 
                 min-length="0" 
                 source="loadData('Tag', $query)">
  </auto-complete>
</tags-input>

And I can see only 10 results, but I need see all results.

Upvotes: 1

Views: 1161

Answers (1)

Michael Benford
Michael Benford

Reputation: 14104

As said on the docs, you can set how many matches will be displayed at a time by using the maxResultsToShow option:

<auto-complete load-on-focus="true" 
               load-on-empty="true" 
               min-length="0" 
               source="loadData('Tag', $query)"
               max-results-to-show="20">
</auto-complete>

Working Plunker

FWIW, your markup tells me that you're using a fork/custom version of ngTagsInput, since the input-tabindex attribute isn't known by the directive. My answer should still apply, though.

Upvotes: 2

Related Questions