Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is `route.transitionTo` deprecated?

Ember logs a warning that transitionTo has been deprecated in favor of transitionToRoute. However, ember currently has route.transitionTo and controller.transitionTo. Only controller.transitionTo has a deprecation notice on the API and in the source code.

Is the notice that route.transitionTo is deprecated a bug, or is the idiomatic method of transitioning changing to this.controllerFor( routename ).transitionToRoute().

ANSWER: NOT DEPRECATED

Turned out I had a mixing using this.transitionTo that was supposed to be involved in route's only but was getting used in a controller, which made it harder to notice.

like image 451
runspired Avatar asked Dec 17 '13 21:12

runspired


2 Answers

from a controller you should use controller.transitionToRoute (specifying that you want to transition a route) from a route you should use route.transitionTo and it makes sense that route is implied due to the context.

like image 157
Kingpin2k Avatar answered Oct 14 '22 15:10

Kingpin2k


transitionTo should only throw a warning in a controller, You're most probably using transitionTo in some controller somewhere.

From within routes:

this.transitionTo('someRoute');

From within controllers:

this.transtionToRoute('someRoute');

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

like image 1
iConnor Avatar answered Oct 14 '22 17:10

iConnor