mercredi 18 novembre 2015

Ember 2.0 get another router from router/controller

Is there any way to call route action from another router/controller? Lets say I have two routes:

App.RouteOne = Ember.Object.extend({
   actions: {
      someCommonFunctionality: function() {
         // ...
      }
   }
});

App.RouteTwo = Ember.Object.extend({
   actions: {
      // Here I want to call someCommonFunctionality function from RouteOne
   }
});

Is this somehow possible? I have an AJAX get method that I do not want to repeat in RouteTwo as I have it already in RouteOne

Aucun commentaire:

Enregistrer un commentaire