Created
June 6, 2013 18:51
-
-
Save eibrahim/5723926 to your computer and use it in GitHub Desktop.
Angular Directive for jQuery Chosen plugin. Usage: <select chosen=""></select>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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