samedi 14 novembre 2015

Where to run jQuery after ember template renders?

With Views deprecated, I'm having trouble discerning where to run jQuery after a template has rendered.

I have a simple index template for a foods resource (templates/foods/index.hbs), and wish to run the following jQuery after index.hbs renders:

this.$('[data-toggle="tooltip"]').tooltip();

I know one can create a Component that then has a didInsertElement hook, but I'm not clear on how I'd route to the Component if I did this. Would I then "double dip" by having my apps/templates/foods/index.hbs template simply call the new Component, which would be the original apps/templates/foods/index.hbs?

I'm sure I'm missing something simple here. Anyone care to point me in the right direction?




Aucun commentaire:

Enregistrer un commentaire