Skip to content

Router supports didTransition, but not willTransition #10235

@asakusuma

Description

@asakusuma

Currently the Router supports the Route didTransition event:

App.Router = Ember.Router.extend({
      myAfterTransitionHook: function() {
            //stuff       
      }.on('didTransition')
});

However, the Router does not support the Route willTransition event. In other words, you can't do this:

App.Router = Ember.Router.extend({
      myBeforeTransitionHook: function() {
            //stuff       
      }.on('willTransition')
});

Is there a specific reason for not supporting willTransition? If not, I'd be happy to submit a PR. I'd like to be able to save/record state right before a transition happens, on a general level, not specific to an individual route. Something along the lines of intercepting any time {{link-to}} happens.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions