我通过调用 API 从集合中获得了一个 Json。
{
"next_page_link": null,
"prev_page_link": null,
"posts": [
{
"id": 1,
"public": true,
"actor": {
"displayName": "Srikanth Jeeva",
"id": "28"
}
},
{
"id": 2,
"public": true,
"actor": {
"displayName": "Srikanth jeeva",
"id": "21"
}
}]
}
这是意见:
Raffler.Views.StreamsIndex = Backbone.View.extend({
template: JST['streams/index'],
initialize: function(){
this.collection.on('reset',this.render, this);
},
render: function(){
$(this.el).html(this.template({entries: this.collection}));
return this;
}
});
现在我如何在模板中获取这些条目?
<h1>Stream</h1>
<%= entries["posts"] %>
条目[“帖子”] 不显示帖子?