【发布时间】:2014-02-16 04:19:47
【问题描述】:
我正在尝试根据当前路由设置元素类属性。这是在应用程序把手模板中包含的导航把手部分内。
在我的 ApplicationController 中,我可以执行以下操作:
isUsers: ( ->
@get('currentPath') == 'users.index'
).property('currentPath')
在导航模板中,我想执行以下操作:
<a {{bind-attr class="isUsers:active:inactive"}} href="users"></a>
这不起作用 - 始终设置非活动类,即使在正确的应用路径中也是如此。
有什么建议吗?
【问题讨论】:
标签: ember.js