0
votes

I have an ember application with three routes, articles, authors, index, each route has a tab, that has to be initialized via calling this code: $('.ui.tabular .item').tab();, for each route I have a view and call this code like this:

export default Ember.View.extend({
    initSemanticUI: function() {
        Ember.$('.ui.tabular .item').tab({
        });
    }.on('didInsertElement')
});

I have three views for each route all have this piece of code, so the tab works, is this the best approach to enable jquery plugins in ember, what is the proper solution? See here for more info: emberjs where should document ready functions go?

1

1 Answers

0
votes

The best place to put the document ready that apply for all your web site will be in the layout or master page. If you don't have one, i suggest you to build a InitialisationControl method that will be call in each document.ready of each view.

I hope this help.