Skip to content

Instantly share code, notes, and snippets.

@m-coding
Forked from oroce/custom-model-with-view.js
Created April 2, 2016 04:36
Show Gist options
  • Save m-coding/f271c21665d1f95ef29a6eb3e6f5d73c to your computer and use it in GitHub Desktop.
Save m-coding/f271c21665d1f95ef29a6eb3e6f5d73c to your computer and use it in GitHub Desktop.
backbone.js CustomModel with View
var customModel = new CustomModel();
var sampleView = new Backbone.View({
model: customModel
});
var CustomModel = Backbone.Model.extend({
fetch: function(){
this.trigger( "fetch", this );
return Backbone.Model.prototype.fetch.apply( this, arguments );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment