Skip to content

Commit

Permalink
Merge pull request #14643 from ty-ler/dropdown-selected-item-template…
Browse files Browse the repository at this point in the history
…-fix

Fix #14367: Dropdown selected item template
  • Loading branch information
cetincakiroglu authored Feb 1, 2024
2 parents 1abcc8e + e9277ae commit 9b75c71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class DropdownItem {
[attr.required]="required"
>
<ng-container *ngIf="!selectedItemTemplate; else defaultPlaceholder">{{ label() === 'p-emptylabel' ? '&nbsp;' : label() }}</ng-container>
<ng-container *ngTemplateOutlet="selectedItemTemplate; context: { $implicit: selectedOption }"></ng-container>
<ng-container *ngIf="selectedItemTemplate && selectedOption" [ngTemplateOutlet]="selectedItemTemplate" [ngTemplateOutletContext]="{ $implicit: selectedOption }"></ng-container>
<ng-template #defaultPlaceholder>
<span *ngIf="(modelValue() === undefined || modelValue() === null) && (label() === placeholder || (label() && !placeholder))">{{ label() === 'p-emptylabel' ? '&nbsp;' : placeholder }}</span>
</ng-template>
Expand Down

0 comments on commit 9b75c71

Please sign in to comment.