2012-09-02 25 views

回答

1

它看起來像所有的需要的是設置內容屬性來任何東西(甚至只是一個空數組會做)。在這裏看到:http://jsfiddle.net/Cgn2c/2/

App.my_list2 = Ember.ArrayProxy.create({ 
    // the content propery is required, even if it's not used 
    content: [], 
    length: 8, 
    objectAtContent: function(idx) { 
     return "foobar";   
    } 
}); 

<script type="text/x-handlebars"> 
    {{#each App.my_list2}} 
     {{ this }} 
    {{/each}} 
</script>​ 

foobar的foobar的foobar的foobar的foobar的foobar的foobar的foobar的

+0

此外,他錯過了'.property()'原始小提琴中'length'函數,這個例子直接使用8,所以它不需要。 – sabithpocker

+0

使用.property長度方法http://jsfiddle.net/stephane_klein/Cgn2c/3/ –

相關問題