I\'ve followed this great tutorial (link) for Chosen and Angular (code is pretty much same)
Here is my directive:
app.angularModule.directive(\'chose
I've solved it, the solution is pretty easy and straightforward actually (when you get how Angular directives work). Here is whole code for directive:
app.angularModule.directive('chosen', function() {
var linker = function (scope, element, attrs) {
var list = attrs['chosen'];
scope.$watch(list, function () {
element.trigger('chosen:updated');
});
scope.$watch(attrs['ngModel'], function() {
element.trigger('chosen:updated');
});
element.chosen({ width: '350px'});
};
return {
restrict: 'A',
link: linker
};
});