I am writing a read-only form that displays a set of data retrieved on page load. One section on the form is an IsActive dropdownlist with values True or False. On ngOnInit I retrieve this IsActive boolean value from the database and bind it with my model property isActive. I want to display this model value with its matching dropdown value. So for example if the IsActive flag is true, I want the true option from the dropdown to be selected when the page loads.
HTML:
<label class="col-md-2 col-form-label">Is Active</label>
<div class="col-md-10">
<select id="IsActive" name="IsActive" class="form-control" [(ngModel)]="selectedAccount.isActive" [disabled]="!isEditable">
<option [value]="1">True</option>
<option [value]="0">False</option>
</select>
</div>
However the above code has a blank selected option on page load and only when clicked does it show the true and false options