Skip to content

Instantly share code, notes, and snippets.

@lgsunnyvale
Created May 1, 2013 00:55
Show Gist options
  • Save lgsunnyvale/5493054 to your computer and use it in GitHub Desktop.
Save lgsunnyvale/5493054 to your computer and use it in GitHub Desktop.
backbone view and collection wire up
var TestView = Backbone.View.extend({
initialize: function() {
console.log(this.collection)
this.collection.bind("reset", this.render);
this.collection.fetch({reset: true});
},
render: function() {
console.log("being rendered", this);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment