mardi 28 avril 2015

Access target route parameters in beforeModel

How do I access the target route parameters in the beforeModel function when loading a route in Ember?

The documentation refers to beforeModel being the correct place to abort or redirect a transition - but without the target parameters I can't add the required logic to determine if we should redirect.

App.PostRoute = Ember.Route.extend({
  beforeModel: function(transition) {

    // transition doesn't seem to have the target params

  }
});

I was also unable to find any clear documentation on the Transition object described in the API documentation:

http://ift.tt/1tzsoZa




Aucun commentaire:

Enregistrer un commentaire