vendredi 17 novembre 2017

Ember Component can't use vendor.js function

I adopted a legacy project that uses EmberJS 2.5.1, and I have a component that is unable to use the JQuery UI Sortable method. The vendor folder contains jquery.ui.min.js, and ember-cli-build.js imports it.

This is what I currently have in my code:

Ember.$("#cute_table_of_puppies_eating_clowns tbody").sortable({}) (Sortable has been simplified for example purposes...)

In Chrome's Debugger it converts to...

_ember["default"].$("#cute_table_of_puppies_eating_clowns tbody").sortable({})

The JQuery selector works, but it cannot find the selector. I put a break point on that line, and tried $("#cute_table_of_puppies_eating_clowns tbody").sortable({}) from the console. This ends up working.

What do I need to do to properly use this function from a component?




Aucun commentaire:

Enregistrer un commentaire