1
votes

I want execute couple of ember actions synchronously, what is the right way to do this. For example

this.send('closeModal');
this.send('openModal','login'); // run when `closeModal` is totally executed

or how to call action in route without using send

export default Ember.Route.extend({
actions:{
   openModal: function () {
    //how to execute like this.closeModal(); without .send
       ... logic...
    });
   closeModal: function () {
       ... logic...
    });
}
});
1

1 Answers

1
votes

Perhaps you could move the action logic to other functions on the route i.e.

export default Ember.Route.extend({
  openModal: function() {
    ...logic...
  },

  closeModal: function() {
    ...logic...
  },

  actions:{
    openModal: function () {
      this.closeModal(); // Ensure other modals are closed.
      this.openModal();
    });

    closeModal: function () {
      this.closeModal();
    });
  }
});