ui-select指令 ui-select的指令和事件 属性 选项 描述 值 默认值 multiple 多选,直接加上multiple属性 close-on-select 在多选情况下,选中一项,就关闭下拉项 someFunction($item, $model)" on-select 当项被选中时发生 on-select="someFunction($item, $model)" 全局配置 你可以使用全局配置来配置你的ui-select = 'bootstrap'; uiSelectConfig.resetSearchInput = true; uiSelectConfig.appendToBody= true; }); 主题 ui-select </ui-select> 添加引用 使用主题需要应用相应css 主题: bootstrap 文件: <link rel="stylesheet"href="bower_components/bootstrap
Angular中ui-select的使用 最近工作一直很忙,没有时间整理知识,前几天项目中需要用到angular-ui-select,实现下拉框快速过滤效果,今天有时间研究了一下,终于搞明白了。 注意引入的先后顺序 2.html代码 1 <ui-select ng-model="$parent.test" theme="bootstrap" style="min-width: 300px;" s.name | highlight: $select.search">
文档原文地址 https://github.com/angular-ui/ui-select/wiki 入门指南 简介 ui-select是AngularJS官方制作的下拉框插件,和AngularJS搭配使用 引入文件 select.js select.css 在你的appliction的modules中包含ui-select、ngSanitize模块 var module = angular.module( 'myapp',['ui.select', 'ngSanitize']); 基本例子 html代码 <ui-select ng-model="selected.value"> <ui-select-match ) track by item.id"> </ui-select-choices> </ui-select > ui-select是控件的主标签,它包含数据绑定和空间的基本设置。
task代码如下: gulp.task('vendor', function () { gulp.src([ 'app/assets/bower_components/ui-select assets/bower_components/angular-sanitize/angular-sanitize.min.js', 'app/assets/bower_components/ui-select