Is there an equivalent function to grab the currentPath in the console with the new router in ember?
Before, I was able to do this:
App.router.get("currentPath")
However, it seems with the new router, you can't access the router in the same fashion. In fact App.router simply returns undefined.
Any help here would be greatly appreciated.
edit:
On a related note, because I can no longer access App.router
and its properties, I can't figure out how to manually trigger state changes. For example,
App.router.transitionTo("some.state")
is no longer viable. What is everyone doing instead of this now?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With