ng-bootstrap NgbTypeahead如何响应选择? [英] ng-bootstrap NgbTypeahead How to react on select?
问题描述
通过使用typeahead控件,用户可以从列表中选择一项(文档, plnkr ).
我如何对选择做出反应?我设法通过在输入中添加(keyup.enter)事件然后在组件上调用另一个方法来对enter做出反应,但是似乎无法在typeahead-popup中的鼠标选择上触发该事件.
我该如何实现?
有一个selectItem
输出(事件),当用户执行项目选择时将触发该输出(无论选择方法如何). selectItem
输出是正式的预录文档的一部分 >
Using the typeahead control allows a user to select a term from a list (Documentation, plnkr).
How can I react on a selection? I managed to react on enter by adding a (keyup.enter) event to the input then call another method on my component, but I cannot seem to get an event that fires on mouse-selection in the typeahead-popup.
How can I achieve that?
There is the selectItem
output (event) that is fired when a user does item selection (regardless of the selection method). The selectItem
output is part of the official typeahead documentation
这篇关于ng-bootstrap NgbTypeahead如何响应选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!