在Angular 1中,我可以使用以下命令为下拉框选择默认选项:
<select
data-ng-model="carSelection"
data-ng-options = "x.make for x in cars" data-ng-selected="$first">
</select>
在Angular 2中,我有:
<select class="form-control" [(ngModel)]="selectedWorkout" (ngModelChange)="updateWorkout($event)">
<option *ngFor="#workout of workouts">{{workout.name}}</option>
</select>
给定我的选项数据,我该如何选择默认选项:
[{name: 'arm'}, {name: 'back'}, {name:'leg'}]
我的默认值是back
多少?