1

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?

1 Answer 1

1

You can include textField: 'name' in your dropdownSettings. ng-multiselect-dropdown

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.