-
-
Save m-coding/f271c21665d1f95ef29a6eb3e6f5d73c to your computer and use it in GitHub Desktop.
backbone.js CustomModel with View
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var customModel = new CustomModel(); | |
var sampleView = new Backbone.View({ | |
model: customModel | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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