我有以下代码
<md-select multiple ng-model="filtered" placeholder="Select a team member" ng-show="onTeam">
<md-option ng-value="opt.value" ng-repeat="opt in allowedStatuses" selected="{{ opt.value === opt.last ? 'selected' : '' }}">{{ opt.title }}</md-option>
</md-select>
我希望始终选择最后一个选项。怎么做?
答案 0 :(得分:0)
答案就是这个......
<md-select multiple ng-model="filtered" placeholder="Select a team member" ng-show="onTeam">
<md-option ng-value="opt.value" ng-repeat="opt in allowedStatuses" ng-selected="{{ opt.title == 'Myself' }}">{{ opt.title }}</md-option>
</md-select>
需要ng-selected
而不是selected
...