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?"
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
This should do the trick:
App.ApplicationView = Ember.View.extend({
didInsertElement: function(){
$(document).foundation();
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With