Created
August 16, 2013 18:03
-
-
Save mspanish/6252084 to your computer and use it in GitHub Desktop.
From http://stackoverflow.com/questions/8782619/how-to-build-a-collection-model-from-nested-json-with-backbone-js - Getting to the JSON of the nested models in Backbone.js
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
var AmericasNextTopModel = Backbone.Models.extend({ | |
initialize: function(){ | |
this.set({ | |
clefs: new ClefCollection(this.get('clefs')), | |
accidentals: new AccidentalCollection(this.get('accidentals')), | |
notes: new NoteCollection(this.get('notes')), | |
rests: new RestCollection(this.get('rests')) | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment