UI Select Example
HTML
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-select/0.19.8/select.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-select/0.19.8/select.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.3/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.3/angular-sanitize.js"></script>
<p>
</p>
<div ng-app="app" ng-controller="myCtrl as vm">
<ui-select tagging ng-model="vm.selected" theme="bootstrap">
<ui-select-match placeholder="Pick one...">{{$select.selected.value}}</ui-select-match>
<ui-select-choices repeat="val in vm.values | filter: $select.search track by val.value">
<div ng-bind="val.value | highlight: $select.search"></div>
<uis-open-close uis-open-close="openClose(isOpen)"/>
</ui-select-choices>
</ui-select>
</div>
JavaScript
var app = angular.module('app', ['ui.select']);
app.controller("myCtrl", function ($scope) {
vm = this;
vm.isLoaded = false;
vm.values = [{
'key': 22,
'value': 'Kevin'
}, {
'key': 24,
'value': 'Fiona'
}];
vm.selected;
$scope.openClose = function(isOpen) {
alert(isOpen);
};
});