html
<select ng-model="app.model.property" ng-options="item.id as item.title for item in app.dictionaries.categories" ng-chosen=""></select>
js
/**
* jQuery-chosen wrapper
* @see [url]http://harvesthq.github.io/chosen/[/url]
*/
.directive('ngChosen', [
function() {
return {
link: function(scope, element, attributes) {
var options = scope.$eval(attributes.ngChosen);
var settings = angular.extend({}, options);
element.chosen(settings);
element.bind('$destroy', scope.$watch(attributes.ngModel, handler));
element.bind('$destroy', scope.$watch(attributes.ngDisabled, handler));
element.bind('$destroy', destructor);
// -----------------------
function handler() {
element.trigger('chosen:updated');
}
function destructor() {
element.chosen('destroy');
}
}
};
}
])