html中
<select id="selectparent" class="form-control select2" ng-model="parent">
<option value="">请选择</option>
<option ng-repeat="item in list" value="{{item.id}}">{{item.name}}</option>
</select>
js中确定某个项被选中
setTimeout(function () {
set_select_checked('selectparent', 1);
}, 500);
function set_select_checked(selectId, checkValue) {
var select = document.getElementById(selectId);
for (var i = 0; i < select.options.length; i++) {
if (select.options[i].value == checkValue) {
select.options[i].selected = true;
break;
}
}
}