Javascript 角度ui选择不工作
我在项目中使用angular ui select。我正在使用Javascript 角度ui选择不工作,javascript,jquery,angularjs,angular-ui-select,Javascript,Jquery,Angularjs,Angular Ui Select,我在项目中使用angular ui select。我正在使用ui选择指令 我的代码: <select class="input-small" ng-model="dashboard.style" ng-options="f for f in ['light','hpexp']" ng-change="styleUpdated()"></select> 我想使用ui选择,所以我这么做了 &
ui选择
指令
我的代码:
<select class="input-small" ng-model="dashboard.style" ng-options="f for f in ['light','hpexp']" ng-change="styleUpdated()"></select>
我想使用ui选择,所以我这么做了
<ui-select id="viewSelector"
class="viewSelector input-small"
ng-model="dashboard.style"
ng-options="f for f in ['light','hpexp']"
ng-change="styleUpdated()"
theme="selectize">
<ui-select-match placeholder="-- Select --">
{{$select.style}}</ui-select-match>
</ui-select>
{{$select.style}
但它不起作用。如何在ui选择中使用ng选项
谢谢 请使用ui选择选项
而不是ng选项
。让我们试试下面的代码,而不是你的
<ui-select id="viewSelector"
class="viewSelector input-small"
ng-model="dashboard.style"
ng-change="styleUpdated()"
theme="selectize">
<ui-select-match placeholder="-- Select --">
{{$select.style}}</ui-select-match>
<ui-select-choices repeat="f for f in ['light','hpexp']">
<div ng-bind-html="f"></div>
</ui-select-choices>
</ui-select>
{{$select.style}
更多详细信息,请阅读此讨论
您能在fiddler中添加此代码吗?当然。。让我试试……预期表达式的形式为“集合中的项”[track by _id]”,但在['light','hpexp']中得到了“f for f”。收到此错误谢谢,请尝试此repeat=“f in['light','hpexp']”
但选择任何选项。。{{$select.style}}它没有显示任何内容。。如果你能帮上忙,那就太棒了