Skip to content

Instantly share code, notes, and snippets.

@havvg
Created September 7, 2012 19:46
Show Gist options
  • Save havvg/3669049 to your computer and use it in GitHub Desktop.
Save havvg/3669049 to your computer and use it in GitHub Desktop.
BackboneJS with your base model
(function(Sternenbund, $, undefined) {
Sternenbund.Model = Backbone.Model.extend({
url: function() {
return this.urlRoot+'/'+this.id+'.json';
}
});
// ..
Sternenbund.Venad = Sternenbund.Model.extend({
id: null,
name: null,
researches: new Sternenbund.ResearchCollection(),
urlRoot: '/api/venad'
});
// ..
}(window.Sternenbund = window.Sternenbund || {}, jQuery));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment