我正在尝试观察另一个子控制器。
我有以下路由器:
this.resource('generics', {path: '/gens'}, function() {
this.resource('generic', {path: '/:generic_id'}, function() {
this.route('prepare'); // Objectcontroller
this.route('sent'); // Objectcontroller
});
});
我在发送的控制器中有一个观察者,但是它不起作用。我目前有:'controllers.sent。Id '获取在preparecontroller中准备好的Id。如果我用generic.prepare
计算needs
的性质。它显示如下错误:
#needs must not specify dependencies with periods in their names (generic.sent)
我也尝试使用setupController添加id到发送的控制器属性,但是观察者是毫无价值的。
应该是genericPrepare
,但prepare
/sent
不应该同时存在。您最好将对象发送给generic
,然后让sent
从中获取属性。为什么你反对在setupController
期间设置它?路由总是会在最终用户看到之前到达sent
的setupController
。