Created
September 7, 2012 19:46
-
-
Save havvg/3669049 to your computer and use it in GitHub Desktop.
BackboneJS with your base model
This file contains 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
(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