我有嵌套资源:
this.resource('foo', {path: '/foo/:foo_id'}, function() {
this.route('makesomethingwithfoo');
this.resource('bar', {path: 'bar/:bar_id'}, function() {
this.route('makesomethingwithbar');
我想使用模型foo
中的一些属性,而我在#/foo/321421/bar/231421
. 我的BarIndexController
样子是这样的:
... = Ember.ObjectController.extend({
needs:'fooIndex',
//myBinding: 'controllers.fooIndex',
....});
如果我使用我的模板,controllers.fooIndex.desiredProperty
我可以访问 model 的属性foo
。我想使用myBinding
以节省多写几个字符(controllers.fooIndex
)。我认为我做的一切都是正确的,至少根据文档看起来是正确的。我收到此错误:
Uncaught Error: assertion failed: Cannot delegate set('my', <(subclass of
Ember.ObjectController):ember238>) to the 'content' property of object proxy
<(subclass of Ember.ObjectController):ember249>: its 'content' is undefined