在 ember 中处于 inBuffer 状态时不能修改子视图

You cannot modify child views while in the inBuffer state in ember

在我的 ember 应用程序(版本 1.9.1 - EAK)中,我在 hbs 文件中有一些东西,例如,

{{#each obj.obj1}} 

 {{#view "selection" model = this}}
 ---------some code-------
 {{/view}}

{{/each}}

一切正常。如果我这样改,

{{#each item in obj.obj1}} 

 {{#view "selection" model = this}}
 ---------some code-------
 {{/view}}

{{/each}}

收到错误 "You cannot modify child views while in the inBuffer state in ember"。

这通常意味着出现了严重错误。例如,您的视图可能无法正确派生自 Ember.View

但是,在这种特殊情况下,您需要 model=item 而不是 model=this{{#each..in}} 形式不设置 thisthis 仍将是循环外的内容。