angularjs ui-select如何设置默认选中值

来源:互联网 发布:win8数据恢复软件 编辑:程序博客网 时间:2024/05/06 02:06

angularjs ui-select如何设置默认选中值,可以采用ng-model来设置,示例如下:

            <div class="col-sm-6">                   <ui-select ng-model="provinces.selected" theme="bootstrap"                         on-select="loadCitys($item, $model)"> <ui-select-match                         placeholder="选择省份">{{$select.selected.name}}</ui-select-match> <ui-select-choices                         repeat="province in provinces  | filter: $select.search">                     <div ng-bind-html="province.name | highlight: $select.search"></div>                     </ui-select-choices> </ui-select>                 </div>

只要设置了 ng-model并设置它的值 ,就可以出来默认选 中了。

0 0
原创粉丝点击