Skip to content

Instantly share code, notes, and snippets.

@wrburgess
Forked from jhirn/MyView.js
Created February 17, 2014 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wrburgess/9060518 to your computer and use it in GitHub Desktop.
Save wrburgess/9060518 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({
}));
},
});
//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([{...},{...}])
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment