答案 0 :(得分:3)
只需在您的课程正文中初始化statusValueToSet
,但请在选择中保留Choose here
选项:
// extract from template
<div class="form-group">
<label for="status">Status: </label>
<select class="form-control" name="status" #status="ngModel" [(ngModel)]="statusValueToSet" required>
<option [value]="''">Choose here</option>
<option *ngFor="let status of statuses" [value]="status">{{status}}
</option>
</select>
</div>
statuses: string[] = ["New", "Accepted", "Invalid"];
statusValueToSet: string = "";