【问题标题】:In angular-ui-bootstrap's typeahead, how can I use a custom popup template AND custom item template?在 angular-ui-bootstrap 的 typeahead 中,如何使用自定义弹出模板和自定义项模板?
【发布时间】:2016-09-09 23:22:31
【问题描述】:

使用https://angular-ui.github.io/bootstrap/ 预输入

我似乎无法添加自定义弹出模板和自定义项模板。

我已经尝试在我的自定义弹出窗口中进行更改:

<div uib-typeahead-match index="$index" match="match" query="query" typeahead-template-url="app/components/localIntentsPicker/typeahead-item.html"></div>

我可以删除这个 div 并直接添加我自己的更改,但是我失去了对预输入选择的键盘控制。

我还尝试将以下内容添加到我的主要预输入输入中。

typeahead-template-url="app/components/localIntentsPicker/typeahead-li.html

似乎都不起作用。

【问题讨论】:

    标签: angular-ui-bootstrap


    【解决方案1】:

    原来我做错了一些事情。

    项目模板代码需要包裹在&lt;a&gt; 中以保持键盘选择。

    最重要的是,将 template-url 用额外的引号括起来解决了这个问题:

    <div uib-typeahead-match index="$index" match="match" query="query" template-url="'app/components/localIntentsPicker/typeahead-item.html'"></div>
    

    【讨论】:

      猜你喜欢
      • 2016-06-26
      • 2017-04-16
      • 1970-01-01
      • 1970-01-01
      • 2012-01-25
      • 1970-01-01
      • 1970-01-01
      • 2018-12-15
      • 1970-01-01
      相关资源
      最近更新 更多