disable p-dropdown option when options are display in ng-template for looping them

Discussão em 'Angular' iniciado por Asaf Abekasis, Dezembro 9, 2024.

  1. i am trying to disable option in p-dropdown but i use ng-template for looping the options

    here is my code any suggestions ? thanks

    <p-dropdown
    [options]="task.statusOptions"
    optionLabel="name"
    optionValue="id"
    (onChange)="updateTaskCurrentStatus($event, task)"
    appendTo="body"
    [placeholder]="this.dropdownPlaceholder(task)"
    >
    <ng-template let-status pTemplate="status">
    <div [ngStyle]="{ color: status.uiSetting.color}" [ngClass]="{'pointer-events-none': status.enabled}">{{ status.name }}</div>
    </ng-template>
    </p-dropdown>

    Continue reading...

Compartilhe esta Página