Search code examples
twitter-bootstrapangularbootstrap-typeaheadng-bootstrap

ng-bootstrap NgbTypeahead How to react on select?


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?


Solution

  • 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