JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="http://silviomoreto.github.io/bootstrap-select/javascripts/bootstrap-select.js"></script>
<link rel="stylesheet" href="http://silviomoreto.github.io/bootstrap-select/stylesheets/bootstrap-select.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css">
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
<div ng-app="demo" ng-controller="MainCtrl">
<pre>You have selected : {{ selected | json }}</pre>
<div ng-model="selected"
class="selectpicker"
options="issues"
title='Choose one of the following...'>
</div>
</div>
CSS
body {
padding: 1em;
}
JavaScript
angular.module('demo', []);
angular.module('demo')
.directive('selectpicker', function ($timeout) {
return {
restrict: 'C',
require: 'ngModel',
replace: true,
template: '<select multiple><option ng-repeat="opt in options">{{ opt }}</option></select>',
scope: {
title: '@',
options: '='
},
link: function (scope, element, attrs, ngModel) {
var $el = $(element);
$timeout(function () {
$el.selectpicker({
style: 'btn-default',
size: false
});
});
$el.on('change', function (ee, aa) {
ngModel.$setViewValue($el.val());
scope.$apply();
});
}
};
});
angular.module('demo')
.controller('MainCtrl', function ($scope) {
$scope.selected = [];
$scope.issues = [
'Repair',
'Sale',
'Purchase',
'Screen'
];
});