这是我在html中用于ng-multiselect-dropdown的代码:
<div class="form-group" *ngIf="paisActivo != '-1'">
<ng-multiselect-dropdown
[placeholder]="'[Seleccione Marca]'"
[data]="dataMarcas"
[(ngModel)]="adminTresActivos"
[settings]="dropdownSettings"
(onSelect)="onItemSelect($event)"
(onDeSelect)="onItemDeSelect($event)"
[class]="'form-control custom-form-control'"
>
</ng-multiselect-dropdown>
</div>
当前,dataMarcas
返回一个数组:
marcas: [
'ABC',
'XYD',
'ETC',
]
但是现在我必须用这样的数组填充下拉列表:
[
{icon: "aquiles.png", id: 853, name: "AQUILES"},
{icon: "arkan.png", id: 855, name: "ARKAN"}.
etc
]
我必须用name
属性填充它。我该怎么办?