我希望DropDown
将属性名称显示为Description
,将id
属性绑定到模型并显示ScoreName
所选项目的属性。有没有办法做到这一点ng-select
?
Scores = [
{ id:1, ScoreName:'1', Description:'Bad' },
{ id:2, ScoreName:'2', Description:'Good' },
{ id:3, ScoreName:'3', Description:'Best' }
]
<ng-select class="score" name="score" appendTo="body" [loading]="!loaded"
[items]="Scores" bindLabel="ScoreName" bindValue="ScoreName"
placeholder="" [(ngModel)]="row.Score">
</ng-select>