我在我的页面中包含了ui-select js和css:
<link href="assets/plugins/ui-select/select.min.css" rel="stylesheet"
type="text/css"
<script src="assets/plugins/ui-select/select.min.js" tyle="text/javascript"
</script>
我添加了ui-select作为:
<div class="form-group">
<label>Type <span style="color:red;">*</span></label>
<ui-select ng-model="form.type" theme='bootstrap' close-on-select='false'
ng-required="true">
<ui-select-match placeholder='select type'>
{{$select.selected.value}}
</ui-select-match>
<ui-select-choices repeat='t.id as t in types | filter:$select.search'>
<div ng-bind-html-unsafe="t.value"></div>
<small>
{{t.value}}
</small>
</ui-select-choices>
<ui-select>
</div>
in js:
angular.module('backOfficeApp)
.controller('ManagementReportsCtrl, ManagementReportsCtrl);
ManagementReportsCtrl.$inject=['$sce','$scope','$http','$filter'];
function ManagementReportsCtrl($sce,$scope,$http,$filter){
并获取$scope的函数。Types = data;?UI-SELECT没有出现在我的模板中,有解决方案吗?
你需要添加依赖到你的模块
angular.module('backOfficeApp', ['ui.select'])
.controller('ManagementReportsCtrl, ManagementReportsCtrl);
...