Emberjs - 如何访问RC1中的当前状态或路由名称? [英] Emberjs - How to access the current state or route name in RC1?
本文介绍了Emberjs - 如何访问RC1中的当前状态或路由名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在RC1中如何获取当前的全局名称或当前路由名称?
In RC1 how can I get the currentstatename or current route name globally?
更具体的替代语法如下:
App.get('router')。currentState.name;
More specific, alternate syntax of : App.get('router').currentState.name;
推荐答案
看看这个问题的答案: Ember App.Router.router.currentState undefined
Have a look at the answer to this question: Ember App.Router.router.currentState undefined
简短答案:当前状态为在ApplicationController中以currentPath的名称存储。
Short answer: The current state is stores in the ApplicationController under the name "currentPath".
这篇关于Emberjs - 如何访问RC1中的当前状态或路由名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文