I would like to static add options for p-dropdown.
<p-dropdown [(ngModel)]="selectedOption"
placeholder="Select options" optionLabel="name"
(onChange)="onChangeOption()">
<option *ngFor="let item of items;" [value]="item.value">{{item.label}}</option>
<option value="null">Others</option>
</p-dropdown>
I have tried to dynamic add the “Others” option at ts file, but I still want to static add like this
Is there any better way to do this ? Tks you all
New contributor
tuongduy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.