是否可以通过车把将数据链接到 Ember.view ?像带有 valueBindig 的 Ember.Select。
我的尝试:
{{#each models}}
<li>{{id}}</li>
{{/each}}
// -> 1,2,3 (this works fine)
{{view App.TimelineView valueBinding="models.id"}} //this doesn't work
App.TimelineView = Ember.View.extend({
tagName: 'div',
attributeBindings: ["value"],
value: null,
didInsertElement: function(){
console.log(this.value)
...
})
控制台日志:---> null
但我需要 [1,2,3]