lundi 3 avril 2017

Unable to get current route instance in observers

I am now with ember js. I need current route instance in controllers observer. I tried many links and searched a lot but still not able to get the route instance in observer method. There is the code.

activeStagesChanged: Ember.observer('activeStages.[]', function () {
    let self = this;

    Ember.run.scheduleOnce('afterRender', function () {
      initCustomScrollbar('#status_timeline_box');

      self.handleAppStages(self.get('model'), self.get('currentUser.isConfirmAppStageChange'),
          Ember.getOwner(self).lookup('controller:application'));
    });
  })

Ember.getOwner(self).lookup('controller:application') this is the code that I assuming to return the route object.




Aucun commentaire:

Enregistrer un commentaire