2
我需要Ember中的递归嵌套视图。基本上认为它是一个文件夹结构。Ember中的嵌套视图
我以为我可以用render
做到这一点,但那并不奏效。内部structures/show
观点:
{{#each child in structures}}
{{ render 'structures/show' child }}
{{/each}}
我得到的错误:
Uncaught Error: assertion failed: This view is already rendered
我在另一个SO Question阅读有关使用{{view}}
帮手:
{{#each child in structure.structures}}
{{ view App.StructuresShowView structureBinding='child'}}<br>
{{/each}}
但是,这并不正确渲染。可能是因为这个例子太旧了?
如何正确渲染与不同对象相同的视图(和控制器?)以构建嵌套/递归视图?有没有比物体方向更好的方法?
谢谢。
更新。看起来像itemControllerClass可能是我在找什么?仍在试图弄清楚。
谢谢双胞胎。我希望有一个更简单的方法来设置它(或只是一个有效)。我一直在试图做一个[jsbin](http://jsbin.com/ogapux/6/edit)让_something_工作,但我还没有成功。 – RyanJM 2013-02-20 19:34:56
我有一个解决方案,使用{{controll}}工作[这里](http://jsbin.com/ogapux/9/edit)。我希望有更好的东西。 – RyanJM 2013-02-20 21:06:32