The p-dropdown below is reading json data from API. Among the data values, I want to set up "apple" by default. Currently, in the p-dropdown, the first thing users can see is the placeholder value (i.e "Select a Product").
How can I preset a default value in p-dropdown? Any help or advice, please?
<p-dropdown
[options]="products"
optionLabel="productName"
optionValue="productId"
placeholder="Select a Product"
[filter]="true"
filterBy="productName"
></p-dropdown>
[
{
productName: "apple",
productId: 1
},
{
productName: "banana",
productId: 2
},
{
productName: "watermelon",
productId: 3
},
]