Uncaught TypeError: this.transitionTo is not a function

I just upgraded the application to ember 2.1 and got this error in my web browser console:

 Uncaught TypeError: this.transitionTo is not a function 

In my url, I have a variable called direction :

 http://localhost:4200/plates/new?direction=plates 

Then I create this in my controller:

 export default Ember.Controller.extend({ queryParams: ['direction'], direction: null, actions: { lastpage(){ this.transitionTo(this.get('direction')); }, save(...){ }, }, }); 

This worked before my update. What has depreciated / how can I fix this error?

+5
source share
2 answers

From the controller, you should use this.transitionToRoute instead of this.transitionTo . This has been deprecated for most of 1.x.

+16
source

Controller does not have a transitionTo method. This is the Route method. The controller has a transitionToRoute method.

+3
source

Source: https://habr.com/ru/post/1234836/


All Articles