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