【发布时间】:2017-09-05 18:22:43
【问题描述】:
我有这个数组:
[{
"user_id": 101,
"user_name": "John"
},
{
"user_id": 101,
"user_name": "Ganesh"
},
{
"user_id": 101,
"user_name": "Irfan"
}]
在我的 HTML 中,我有这个:
<p-autoComplete placeholder="User Search..." field="user_name" [suggestions]="suggestionList" (completeMethod)="userSearch($event)"></p-autoComplete>
我的问题是我可以从自动完成中选择项目并使用 user_id 和 user_name 获取整个对象吗?
【问题讨论】:
标签: angular angular2-template primeng