kbanman / selectize-ng

Selectize directive for AngularJS with two-way bindings for both values and options
MIT License
19 stars 7 forks source link

bug? #3

Closed jacoor closed 10 years ago

jacoor commented 10 years ago

Hello I've been playing with selectize-ng almost whole night today and I didn't get it to work. I am using require.js along with angular. Whatever I do I get: (http://127.0.0.1:8000/static/selectize-ng/dist/standalone/selectize-ng.js:1179:44) which resolves to: a.selectize() || {}), o = b.selectize(n)[0].selectize, o.on("change", function() ... Basically one of the selectizes here is missing. Line in readable form looks like: console.log(element.selectize); //this is empty! selectize = element.selectize(options)[0].selectize; // ~ line 20

Gist: https://gist.github.com/jacoor/8a67ef98205d1df16473

I've read people saying that there is a problem between jquery and other plugins, but I am completely confused right now. Would you be able to help?

jacoor commented 10 years ago

I created test case using require here: https://github.com/jacoor/angular-selectize-ng-require-test

Sorry for not using plunker but this was a bit faster.

jacoor commented 10 years ago

Found it. Problem was race event somewhere called by improper condfiguration of require.js.