Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/452.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 余烬绑定:将属性绑定到其子对象';s属性_Javascript_Ember.js - Fatal编程技术网

Javascript 余烬绑定:将属性绑定到其子对象';s属性

Javascript 余烬绑定:将属性绑定到其子对象';s属性,javascript,ember.js,Javascript,Ember.js,我有一个Ember.View.ParentView,它有两个childview。其中一个是ContainerView。ParentView的另一个子视图需要访问ContainerView的子视图 在ContainerView中,我尝试使用: this.get('parentView').set('foo', this.get('childViews') ) 希望这样可以将ParentView中的属性设置为一个childView视图数组。但是,在ParentView的第二个子视图中,调用:

我有一个Ember.View.ParentView,它有两个childview。其中一个是ContainerView。ParentView的另一个子视图需要访问ContainerView的子视图

在ContainerView中,我尝试使用:

 this.get('parentView').set('foo', this.get('childViews') )
希望这样可以将ParentView中的属性设置为一个childView视图数组。但是,在ParentView的第二个子视图中,调用:

 foo = this.get('parentView').get('foo')

返回类数组而不是实例数组。所以我现在尝试使用绑定。如何创建属性到类子属性的绑定?

使用
viewName
属性设置父实例中的childViews实例的名称(请参阅相关提交):

App.MyParentView
模板:

{{view view.aContainerView viewName="fooContainer"}}

{{view view.anotherView}}

可以创建JSFIDLE来描述您的问题吗?
{{view view.aContainerView viewName="fooContainer"}}

{{view view.anotherView}}