samedi 30 janvier 2016

How to get reference to route inside action handler?

I have a list of project and ability to delete each of them, here is my action handler for doing this:

 deleteProject: function(params) {
   this.store.findRecord('project', params).then(function(project) {
      project.deleteRecord();
      project.save();
      // this.transitionTo('projects');
    });
 }

What I want to do is to redirect back to route where list of project is displayed. As you can see I've tried to do this using this.transitionTo('projects'), but it doesn't work because this does not point to route anymore inside handler.

How to get reference to this route where this handler is declared in order to make transition to another route?

I'm using Ember v. 1.13




Aucun commentaire:

Enregistrer un commentaire