0
我有這個數組:單擊時綁定整個對象(primeng自動完成)?
[{
"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?