是否可以使用模板作为selectionBinding
值?这是我正在尝试做的事情:
控制器:
App.testController = Em.Object.create({
content:[
{title: "abc", index: 1, model: App.s1 },
{title: "def", index: 2, model: App.s2 }
]
}}
看法:
{{#each App.testController.content}}
Title: {{title}} Model: {{model}} Index: {{index}}
{{view Ember.Select
// doesn't work
selectionBinding="App.s" + {{index}}" + ".selected"
contentBinding="App.s" + {{index}} + ".content"
}}
}}
换句话说,迭代中的每个视图都需要绑定到它自己的模型,因此上述语法的任何变体都将受到欢迎。我尝试使用[]
语法,但也.get({{index})
没有任何成功。
在 a 之后我到底可以使用selectionBinding=
什么?