mercredi 2 novembre 2016

Is there any ember event similar to onload

I want to execute my javascript when all content (e.g. images) also has been loaded to my ember application. I already tried didInsertElement() and didRender() hooks but looks like it doesn't wait for background images to load. Here's my code snippet looks like

export default Ember.Component.extend({
    didInsertElement() {
      this._super(...arguments);
      Ember.run.scheduleOnce('afterRender', this, function() {
        var home =$('#main-outlet')[0];
        home.className += " homePage";
        startTimer(5);
      });
    },
});

Any solution or an alternative approach for this?




Aucun commentaire:

Enregistrer un commentaire