How can I access controller properties from inside router?

1.5k views Asked by At

I'm using willTransition hook inside my router as follows.

actions: {
        willTransition(transition) {
            this._super(...arguments);
            //some code goes here
        }
    }

Is there a way to access some property here that is set from controller.

For example: inside my controller, i set value 500 to someProperty as follows.

this.set('someProperty', 500);

How can I access that value inside above method(within the router). Appreciate any help.

1

There are 1 answers

2
Ember Freak On

You can try controller property,

this.controller.set('someProperty',500)