【发布时间】:2014-12-24 09:52:04
【问题描述】:
我的应用程序中设置了一组嵌套资源。我需要为我的一些路线使用 beforeModel 和 afterModel 挂钩。但是,当尝试调用函数或获取另一个控制器的属性时,我收到一条错误消息,指出 the controller named {name} cannot be found。当我尝试在嵌套路由中使用 this.controllerFor('name') 时会发生这种情况。有解决办法吗?
【问题讨论】:
-
controllerFor已被弃用。你应该使用needs: []。这是我最近写的与此相关的答案:stackoverflow.com/a/25175102/1710611
标签: ember.js