1
在Angular 2中动态创建时,如何在选择表单上设置特定选项?在Angular 2中动态创建时,如何在选择表单上设置特定选项?
样品typeModel.type =类型: '红汽车'
contactTypes是的类型的数组,类型: '红汽车' 和 '蓝汽车'
<select class="form-control" name="type" [(ngModel)]="typeModel.type">
<option *ngFor="let contactType of contactTypes">
{{contactType.type}}
</option>
</select>