Typeahead - highlight matching string with typeaheadItemTemplate
ngx-bootstrap: 2.0.5 beta
Angular: 4.4.3
Bootstrap: 3
Build system: Angular CLI
It seems that when we use the Typeahead with typeaheadItemTemplate, the matching string is not highlighted in the suggestion. (see https://valor-software.com/ngx-bootstrap/#/typeahead#item-template)
Could you create a plunkr/stackblitz with reproduction?
You can use one of starter templates:
Plunkr: https://plnkr.co/edit/0NipkZrnckZZROAcnjzB?p=preview
StackBlitz: https://stackblitz.com/edit/ngx-bootstrap-stack?file=app%2Fapp.module.ts
here you go
https://embed.plnkr.co/ZWqwn9d1Gz8IRnrnOoJA/
Ok, got it :)
Actually, it was intended to be this way, because typeaheadItemTemplate option was implemented to give user a full control over template, that's why there's no highlighting. It can be achieved by formatting data in the template itself - just declare one more let-* variable like let-query="query" and then manipulate it as you wish. Anyway, the docs say nothing about this ability so I'll add a few lines about it soon.
A little example - https://plnkr.co/edit/lwf8DjJYaQTKDs4flUmH?p=preview
Ok, thank you :)
Most helpful comment
Ok, got it :)
Actually, it was intended to be this way, because
typeaheadItemTemplateoption was implemented to give user a full control over template, that's why there's no highlighting. It can be achieved by formatting data in the template itself - just declare one morelet-*variable likelet-query="query"and then manipulate it as you wish. Anyway, the docs say nothing about this ability so I'll add a few lines about it soon.A little example - https://plnkr.co/edit/lwf8DjJYaQTKDs4flUmH?p=preview