JavaScript Angular js with jquery multi select plugin angular with jquery example,angular with jquery datatable,angular with

I am using a jQuery plugin which converts a normal select dropdown into a fancy multi select dropdown. Here's the plugin url: http://wenzhixin.net.cn/p/multiple-select/

Now, the problem which i am facing now is that, I am using angular js to bind the dropdown values. And, I used the angular js directives as

app.directive('ccMultipleSelect', function () {
    var directive = {
        link: link,
        restrict: 'A'
    };
    return directive;

    function link(scope, element, attrs) {
        element.multipleSelect({ selectAll: false });
    }
});

And in my html view code is as below:

<select data-ng-options="c.key as c.value for c in vm.units" 
    multiple="multiple" data-cc-multiple-select>
</select>

But, issue is that, when the directive event is called i.e. where the multipleSelect plugin is called, by that time the angular js didn't done its binding and thus the fancy dropdown contains no elements. One quick solution which I thought is to use the setTimeout function to call the plugin after 500ms , but that's not an ideal solution. There must be some other way through which we can watch the dropdown elements and refresh the elements further.

Answer:1

I've been playing around with HTML5 and Javascript a lot lately and have been really impressed with the functionality of LocalStorage as well as SessionStorage. It got me to thinking - with the advent ...

I've been playing around with HTML5 and Javascript a lot lately and have been really impressed with the functionality of LocalStorage as well as SessionStorage. It got me to thinking - with the advent ...

I've created a 3D cube, that rotates clockwise and anti-clockwise on the Y-axis when the left and right keys are pressed, and then rotates on the X-axis when the up key is pressed. My issue is, that ...

I've created a 3D cube, that rotates clockwise and anti-clockwise on the Y-axis when the left and right keys are pressed, and then rotates on the X-axis when the up key is pressed. My issue is, that ...

i was curious if it's possible to inject an value into a directives' close scope. I could't find anything related in the angularjs documentation so I tried something. Does anybody know if there is an ...

i was curious if it's possible to inject an value into a directives' close scope. I could't find anything related in the angularjs documentation so I tried something. Does anybody know if there is an ...

I'm following the current tutorial and for some reason when ever I click on the Sign in with Google button nothing seems to happen and I'm not entirely sure why. Here is the code: <html> <...

I'm following the current tutorial and for some reason when ever I click on the Sign in with Google button nothing seems to happen and I'm not entirely sure why. Here is the code: <html> <...