EmberJS transitionTo gives maximum stack reached error


From the source of Ember JS

ControllerMixin :-

 transitionToRoute: function() {
   // target may be either another controller or a router
   var target = get(this, 'target'),
   method = target.transitionToRoute || target.transitionTo;
   return method.apply(target, arguments);

In case I do an action handling in the controller, my target comes out to be same as controller which is causing this method to go in recursion and ultimately give an “maximum call stack reached error”, I didn’t understand what this code basically do, and why they wrote "//target may be either ‘another’ controller … " because when we are handling the action in controller the target is supposed to be the controller itself.


Post your code or reproduce it with a jsbin/jsfiddle so we can help.


This URL will help you to understand what transitionTo does: http://emberjs.com/guides/routing/redirection/ Note that this is in the documentation website!