2016-05-13 110 views
1

使用https://angular-ui.github.io/bootstrap/ typeheadhead在angular-ui-bootstrap的typeahead中,如何使用自定義彈出模板和自定義項目模板?

它看起來不像我能夠添加自定義彈出模板和自定義項目模板。

我已經在我的定義彈出試圖改變這一點:

<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 

這兩個似乎都沒有工作。

回答

1

原來我做錯了一些事情。

項目模板代碼需要打包在<a>以維護鍵盤選擇。

最重要的是,包裝模板URL額外的報價固定的問題:

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