Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以使用以下方法获取当前路径:
App.__container__.lookup('controller:application').get('currentPath')
但是,我怎样才能获得该路径的 Route 实例?
或者可能:
App.__container__.lookup("controller:application").get("currentRouteName")
简单的:
var pathName = App.__container__.lookup('controller:application').get('currentPath'); var route = App.__container__.lookup('route:' + pathName);