Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
using handlebars with backbone block collection
// Reference:
var ArticleListView = Backbone.View.extend({
el: $('#main'),
render: function(){
var js = this.collection.toJSON();
var template = Handlebars.compile($("#some-template").html());
$(this.el).html(template({articles: js}));
return this;
// Sample Handlebars Template
<script id="some-template" type="text/x-handlebars-template">
{{#each articles}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment