我目前正在使用ui-select(https://github.com/angular-ui/ui-select)进行下拉菜单.我在index.html文件中包含了select.js和select.css.我还通过凉亭安装了角度消毒装置.
这就是我的控制器的样子:
use strict'; angular.module('myApp.home', [ 'ui.select', 'ngSanitize']).controller('ScheduleCtrl', ScheduleCtrl); ScheduleCtrl['$inject'] = [ '$stateParams', '$state' ]; function ScheduleCtrl($stateParams, $state) { var vm=this; vm.itemArray = [ {id: 1, name: 'first'}, {id: 2, name: 'second'}, {id: 3, name: 'third'}, {id: 4, name: 'fourth'}, {id: 5, name: 'fifth'}, ]; vm.scheduleEvents = [{ id:1, name:'Event1' }, { id:2, name:'Event2' }]; }
我的观点包含:
但是,我的视图是空白的,它似乎没有达到ui-select指令.