What is a good way to go about customizing the server's response after a call to a model's fetch()
?
The reason I ask is because I'm dealing with a situation where a model has several child models. The data returned from the server needs to be split up among the child models.
Example:
// A call to "fetch()" on this model needs to split up the returned data
// between the two child models. Once this happens, their 'change'
// events should fire and update their respective views.
var ParentModel = Backbone.Model.extend({
initialize: function(){
this.childModel_01 = new ChildModel_01({});
this.childModel_02 = new ChildModel_02({});
}
})
var ChildModel_01 = Backbone.Model.extend({});
var ChildModel_02 = Backbone.Model.extend({});
Thanks so much!