samedi 14 novembre 2015

didInsertElement in Ember 2.0+

Ember.View is deprecated, in favor of Components. That's great but I'm having trouble making sense of the 2.0 release.

Most often, I used the didInsertElement hook to run some jQuery code etc. But now that the Em.View class has been deprecated, how can I achieve the same thing? I don't want to create a component or anything like that. It doesn't make sense to create components for normal pages(routes). Simply because its not a re-usable thing plus component's scopes are isolated.

Say we have a about route, and when the template is rendered I just want to sun some jQuery code. How can I do this in Ember 2.0+?

Aucun commentaire:

Enregistrer un commentaire