Is `route.transitionTo` obsolete?

Ember warns that transitionTo deprecated in favor of transitionToRoute . However, ember currently has route.transitionTo and controller.transitionTo . Only controller.transitionTo has an API deprecation notice in the source code as well.

Is a notification that route.transitionTo is an obsolete error or is an idiomatic method of switching to this.controllerFor( routename ).transitionToRoute() .

ANSWER: NOT DELETED

It turned out that I had a mix using this.transitionTo , which was supposed to participate only in the route, but was used in the controller, which made it difficult to notice.

+7
javascript deprecated routes
source share
2 answers

from the controller, you should use controller.transitionToRoute (indicating that you want to translate the route) from the route you should use route.transitionTo , and it makes sense that the route is implied due to context.

+4
source share

transitionTo should only throw a warning at the controller , you are most likely using transitionTo in some kind of controller somewhere.

Within the routes:

 this.transitionTo('someRoute'); 

From inside the controllers:

 this.transtionToRoute('someRoute'); 

Source: ( http://github.com/emberjs/website/pull/964 )

+1
source share

All Articles