In this answer, they explained to me that selectItem uses select select.
But at this point, the model tied to the text field is still the source text entered by the user, and not the selection item.
I use
(selectItem)="search(model)"
to receive the event as in TS
search(model) {
this._service.search(model).subscribe(
results => this.results = results,
error => this.errorMessage = <any>error);
}
but, as mentioned above, this calls my backend with user-entered text, not the full text of the selected typeahead element.
My backend magazines
2017/03/24 20:44:14 /api/typeahead/ok
2017/03/24 20:44:14 /api/search/ok
where the second should be / api / search / $ actualSelectedItem.
source
share