Reputation: 8420
This is my code in the html for a 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>
Currently, dataMarcas
returns an array:
marcas: [
'ABC',
'XYD',
'ETC',
]
But now I have to populate the dropdown with an Array like this:
[
{icon: "aquiles.png", id: 853, name: "AQUILES"},
{icon: "arkan.png", id: 855, name: "ARKAN"}.
etc
]
I have to populate it with the name
property. How can I do it?
Upvotes: 1
Views: 3079
Reputation: 334
You can include textField: 'name'
in your dropdownSettings
. ng-multiselect-dropdown
Upvotes: 1