dev-master
9999999-dev https://github.com/angular-ui/ui-selectAngularJS UI Select
MIT
The Requires
angularjs select select2 angular angular-ui
Wallogit.com
2017 © Pedro Peláez
AngularJS UI Select
AngularJS-native version of Select2 and Selectize., (*1)
For the roadmap, check issue #3 and the Wiki page., (*2)
Starting from Internet Explorer 8 and Firefox 3.6 included., (*3)
Check the examples., (*4)
bower install angular-ui-select<script src="bower_components/angular-ui-select/dist/select.min.js"></script>
<link rel="stylesheet" href="bower_components/angular-ui-select/dist/select.min.css">
Make sure composer is install globally before we proceed. After that we need to add below piece of code in composer.json file located inside your project root folder., (*5)
{
"require": {
"components/ui-select": "dev-master"
}
}
composer update and composer will install the component.<script src="components/ui-select/dist/select.min.js"></script>
<link rel="stylesheet" href="components/ui-select/dist/select.min.css">
If you already use Bootstrap, this theme will save you a lot of CSS code compared to the Select2 and Selectize themes., (*6)
Bower:
- bower install bootstrap
- <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">
- Or the LESS version: @import "bower_components/bootstrap/less/bootstrap.less";, (*7)
Bootstrap CDN:
- <link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.css">, (*8)
Configuration:, (*9)
app.config(function(uiSelectConfig) {
uiSelectConfig.theme = 'bootstrap';
});
Bower:
- bower install select2#~3.4.5
- <link rel="stylesheet" href="bower_components/select2/select2.css">, (*10)
cdnjs:
- <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2.css">, (*11)
Configuration:, (*12)
app.config(function(uiSelectConfig) {
uiSelectConfig.theme = 'select2';
});
Bower:
- bower install selectize#~0.8.5
- <link rel="stylesheet" href="bower_components/selectize/dist/css/selectize.default.css">
- Or the LESS version: @import "bower_components/selectize/dist/less/selectize.default.less";, (*13)
cdnjs:
- <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.8.5/css/selectize.default.css">, (*14)
Configuration:, (*15)
app.config(function(uiSelectConfig) {
uiSelectConfig.theme = 'selectize';
});
You cannot write:, (*16)
<ui-select ng-model="item"> <!-- Wrong --> [...] </ui-select>
You need to write:, (*17)
<ui-select ng-model="item.selected"> <!-- Correct --> [...] </ui-select>
Or:, (*18)
<ui-select ng-model="$parent.item"> <!-- Hack --> [...] </ui-select>
For more explanations, check ui-select #18 and angular.js #6199., (*19)
You need to use module ngSanitize (recommended) or $sce:, (*20)
$scope.trustAsHtml = function(value) {
return $sce.trustAsHtml(value);
};
<div ng-bind-html="trustAsHtml((item | highlight: $select.search))"></div>
You are using ng-bind-html with a number:, (*21)
<div ng-bind-html="person.age | highlight: $select.search"></div>
You should write instead:, (*22)
<div ng-bind-html="''+person.age | highlight: $select.search"></div>
Or:, (*23)
<div ng-bind-html="person.age.toString() | highlight: $select.search"></div>
npm install -g bower gulp
npm install && bower install in repository directorygulp to jshint, build and testgulp build to jshint and buildgulp test for one-time test with karma (also build and jshint)gulp watch to watch src files to jshin, build and test when changedWhen issuing a pull request, please exclude changes from the "dist" folder to avoid merge conflicts., (*24)
AngularJS UI Select
MIT
angularjs select select2 angular angular-ui