ng-bootstrap NgbTypeahead How to react on select?
Asked Answered
H

1

1

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?

Histolysis answered 24/3, 2017 at 7:17 Comment(0)
V
4

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

Varese answered 24/3, 2017 at 8:5 Comment(2)
if you can post an example that would be very helpfull, new to typeahead :)Duvall
@IdoBleicher duplicate question with example: https://mcmap.net/q/568826/-ngbtypeahead-selectitem-get-clicked-item-ngbootstrap-angular2Rudelson

© 2022 - 2024 — McMap. All rights reserved.