Open asheshambasta opened 9 years ago
Same.
I struggled with this for so long, even went to try https://github.com/adityasharat/angular-chosen and got the SAME ERROR :angry:
I copied the script files of this other repos gh-page and it suddenly worked, i was confused so i played around with it. And the issue i had was I was loading angular before jquery and chosen. Simple moving the script tag below those 2 but before angular-chosen fixed it. Hope it solves it for anyone else having this issue. The documentation should be more clear on it.
If you load angular before jquery, the element you get in the linker of the directive is a jqLite element and not a jQuery element.
So it won't have the chosen
function on it.
If you load jQuery before angular, angular will use jQuery instead of jqLite.
Why jQuery dependency is mandatory? Jqlite or pure Javascript would not be enough?
TypeError: undefined is not a function at initOrUpdate (http://0.0.0.0:8888/bower_components/angular-chosen-localytics/chosen.js:58:30)
Right off the bat.