/**控制器中*/
/**ui-select2 配置对象 */
$scope.selectOptions = {
/**需要配置一个id的属性,这个属性的值就是你绑定的作用域变量名称(名字必须为:id) */
id:
function(priv) {
return $scope.m.clinicClass;
//页面上绑定的属性名称
}
};
<!--页面视图中-->
<
select
id=
"cid"
ui-select2=
"selectOptions"
ng-model=
"m.clinicClass"
style=
"width: 100%"
>
<
option
ng-selected=
"brand[d]==m.clinicClass"
ng-repeat=
"d in keybrand track by $index"
>{{d}}
</
option
>
</
select
>