Access the new ember router in the console

I found the answer buried in github issues. Re-posting here for posterity.

App.container.lookup('router:main').router

..returns the router. You can access transitionTo and handleURL to manually trigger state changes. Not exactly sure how to get the current state like before, but it seems like you can access the currentHandlerInfos property on the router to get an array of the current handlers (duh).

Hope this prevents someone else from ripping out their hair.


As of the latest build, you can find the router and change state like so:

App.Router.router.transitionTo('posts.comments');

or

App.Router.router.handleURL('/posts/comments');

I don't know if this is the recommended way (the router is very much a moving target at this point), but it works for now.

Tags:

Ember.Js