我是新來的燼,我試着用代碼玩一下,所以我從網站上下載了作爲起始模板的入門工具包。Ember.js Handlebars.helpers.collection不能正常工作
我試圖使用的CollectionView餘燼車把幫手,我複製粘貼示例代碼,但我看到的是「Hi」 3次無名稱:
http://docs.emberjs.com/symbols/Handlebars.helpers.html#method=.collection
我在做什麼有問題?
<script type="text/x-handlebars">
{{#collection contentBinding="App.items"}}
Hi {{content.name}}
{{/collection}}
</script>
<script>
App = Ember.Application.create();
App.items = [
Ember.Object.create({name: 'Dave'}),
Ember.Object.create({name: 'Mary'}),
Ember.Object.create({name: 'Sara'})
]
</script>
謝謝!
杜佩:http://stackoverflow.com/questions/12028209/content-name-returns-empty-for-collection/12028795#12028795 – Rajat
的可能重複的[灰燼.js:把手沒有顯示](http://stackoverflow.com/questions/11818116/ember-js-handlebars-displays-nothing) –