AddChild到父元素(来自iframe)

时间:2015-01-29 20:11:50

标签: javascript angularjs addchild

我想将一个子项添加到这样的元素中:

myLayout.root.contentItems[ 0 ].addChild( newItemConfig );

但是从一个孩子(意思是来自iframe):

parent.myLayout.root.contentItems[ 0 ].addChild( newItemConfig );

当我调用'addChild'时,我得到一个未定义的函数。我怎么能这样做?

BTW我试图从iframe中做到这一点(https://golden-layout.com/examples/#cdcb9de8e7b305d2ec81b4ae4e392832,看看JS代码)

PS我的webapp使用angularjs

1 个答案:

答案 0 :(得分:0)

也许你应该使用appendChild()?