Skip to content

Instantly share code, notes, and snippets.

@eibrahim
Created June 6, 2013 18:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eibrahim/5723926 to your computer and use it in GitHub Desktop.
Save eibrahim/5723926 to your computer and use it in GitHub Desktop.
Angular Directive for jQuery Chosen plugin. Usage: <select chosen=""></select>
'use strict';
angular.module('frontendApp')
.directive('chosen', function ($timeout) {
return {
restrict: 'A',
link: function postLink(scope, element, attrs) {
var deferChosen = function(){
element.chosen({
allow_single_deselect: true
});
element.trigger("liszt:updated");
}
$timeout(deferChosen);
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment