Skip to content

Instantly share code, notes, and snippets.

@jhirn
Last active December 19, 2015 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jhirn/6005682 to your computer and use it in GitHub Desktop.
Save jhirn/6005682 to your computer and use it in GitHub Desktop.
App.Views.MyView = Backbone.View.extend({
initialize: function() {
_.bindAll(this); //Ignore this for now =)
this.template = JST['path/to/template'];
this.render();
},
render: function() {
this.$el.html(this.template({
collection: this.collection
}));
},
});
//Create the view, probably in your server side template
var myView = new App.Views.MyView({
el: "#some-div-to-render-to",
collection: new App.Collections.ThingsToRender([{...},{...}])
})
@wrburgess
Copy link

I can't work with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment