'How to show a value in a dropdown as selected based on some condition in Angular

I have dropdown in my html as below.

<select id="floorplans" class="form-control dropdown mb-8" (change)="changeFloorplan($event.target.value)">
   <option *ngFor="let fp of floorplanList" [value]="fp.id">
        {{ fp?.attributes?.name }}
   </option>
</select>

Here on some event a particular value should be shown as selected when some condition meets. How can I show the required value as selected in the dropdown?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source