如何解决如何在输入框-ngx bootstarp typeahead中显示自定义模板数据
我正在使用 ngx bootstrap typeahead 进行自动完成,如何在执行点击事件后在搜索输入框中显示自定义模板数据。
states: string[] = [
'Alabama','Alaska','Arizona','Arkansas','California','Colorado','Connecticut']
<ng-template #customItemTemplate let-model="item" let-index="index">
<h5>This is: {{model | json}} Index: {{ index }}</h5>
</ng-template>
<pre class="card card-block card-header mb-3">Model: {{selected | json}}</pre>
<input [(ngModel)]="selected"
[typeahead]="states"
[typeaheadItemTemplate]="customItemTemplate"
class="form-control">
我需要在搜索框中显示为“This is Albama Index:1”
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。