4

I have a jQuery plugin from foundation (orbit).

Initially in my app.js I executed this:

$(document).foundation();

However with ember and dynamically loading views if I view the page that is supposed to work on it doesn't work. If I load up the console and manually hit it, it works. So how do I define this to be hit when a page is viewed "the ember way?"

2 Answers 2

4

I usually use the didInsertElement function on the view to set up my Jquery plugins.

ref : http://emberjs.com/api/classes/Ember.View.html#event_didInsertElement

Sign up to request clarification or add additional context in comments.

Comments

3

This should do the trick:

App.ApplicationView = Ember.View.extend({

    didInsertElement: function(){
        $(document).foundation();
    }
});

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.