如何将normal select list
代码转换为angular-ui-select
directive
代码。
我的代码html:
<select class="input-small tight-form-input" ng-model="panel.valueName" ng-options="f.value as f.text for f in bigValueOptions" ng-change="render()"></select>
我的控制器代码:
$scope.bigValueOptions= [{
text: 'min',
value: 'min'
}, {
text: 'max',
value: 'max'
}, {
text: 'avg',
value: 'avg'
}, {
text: 'current',
value: 'current'
}, {
text: 'total',
value: 'total'
}];
我试过的:
<ui-select id="viewSelector"
class="viewSelector input-small tight-form-input"
ng-model="panel.valueName"
theme="selectize"
ng-change="render()">
<ui-select-match placeholder="Select">{{$select.selected.text}}</ui-select-match>
<ui-select-choices repeat="f in bigValueOptions">
<div ng-bind-html="f.text"></div>
</ui-select-choices>
</ui-select>
panel.valueName
没有正确的价值。如何解决此问题或如何将普通选择转换为 ui-select 指令代码。
请指导。