javascript - ngTags 输入 : How to show all results in autocompete?

标签 javascript angularjs autocomplete ng-tags-input

我正在使用 ngTagsInput这是我的标记:

<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>

我只能看到 10 个结果,但我需要看到所有结果。

最佳答案

如前所述on the docs ,您可以使用 maxResultsToShow 选项设置一次显示多少个匹配项:

<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,您的标记告诉我您正在使用 ngTagsInput 的 fork /自定义版本,因为指令不知道 input-tabindex 属性。不过,我的回答应该仍然适用。

关于javascript - ngTags 输入 : How to show all results in autocompete?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37281725/

相关文章:

javascript - 如果选择了输入并单击了按钮,则为 jQuery 条件

AngularJS - 创建使用 ng-model 的指令

javascript - Bootstrap 和 AngularJS : form-control-lg changes only input size, 不是标签

javascript - 防止 typeahead.js 下拉菜单在选择时关闭

javascript - 加载失败,因为找不到支持的源

Javascript:创建循环来检查变量是否为 int

angularjs - 未知提供商 : eProvider <- e when showing material angular dialog

php - Angular 从 php url 获取的数据填充自动完成字段

java - 在 Eclipse 中拼错方法名称后如何恢复自动完成?

javascript - 如何实现类似弹出窗口的 Gchat?