ui-select的默认值,之前在写angular下拉框时,画面初始化时需要设置初始值但是用ng-model绑定时,默认值一直没有出来
<div class="col-sm-3">
<ui-select ng-model="enterprise" theme="bootstrap">
<ui-select-match placeholder="请选择">{
{$select.selected.companyName}}</ui-select-match>
<ui-select-choices repeat="x in enterprises">
<small ng-bind-html="x.companyName"></small>
</ui-select-choices> </ui-select>
</div>
最初,ng-model=“enterprise” 的值是
$scope.enterprise = “XXXXX”(后台或其他页面传过来的);
在页面中值为空,一直以为ui-select默认值是这样正常简单绑定,比如类似其他的
<div class="col-sm-3 control-label">
<input type="te