如何在Angular.js复选框中设置默认选项
<select ng-model="somethingHere" ng-options="option.value as option.name for option in options"></select>
options = [{ name: 'Something Cool', value: 'something-cool-value'}, { name: 'Something Else', value: 'something-else-value'}];
<select ng-model="somethingHere" ng-options="option.value as option.name for option in options" class="ng-pristine ng-valid"> <option value="?" selected="selected"></option> <option value="0">Something Cool</option> <option value="1">Something Else</option></select>
<select ng-model="somethingHere" ....> <option value="0" selected="selected">Something Cool</option> <option value="1">Something Else</option></select>
相关分类