如何在我的 ArrayController.content[] 属性中的数组中显示特定项目?我在下面有这段代码:
App.View.PairView = Em.View.create({
templateName: 'display-template',
controller: App.Controller.PairController
});
App.Controller.PairController = Em.ArrayController.create({
content: [],
createNew: function(){
var weeks = ['1','2','3'];
var quarters = ['Q1', 'Q2', 'Q3'];
var months = ['Jan', 'Sep', 'Dec'];
this.set('content', []);
this.pushObject(weeks);
this.pushObject(quarters);
this.pushObject(months);
}
});
我只想获取 App.Controller.PairController.content[0][0] 或“周”。如果我有下面的车把模板,我该怎么写?
<script type="text/x-handlebars" data-template-name="display-template">
{{#each item in controller}}
???????????????????????
{{/each}}
</script>
谢谢你。