backbone.js - What's the best way to reset deeply nested collections? -


i have following data structure:

one modela has nested collection of modelbs.

each modelb has nested collection of modelcs

by overriding modela's parse method, can bootstrap attributes modela , populate nested collection of modelbs :

assuming server sends { modela_attributes: { ... }, arrayofb_attributes: [{..}, {..}, ..]} can in parse method: modela.nestedbs.reset arrayofb_attributes , return modela_atrributes

the problem how can reset attributes of modelcs each modelb ?

have considered using backbone-relational? it'll handle of these. found race condition doing kind of stuff few weeks ago, looks paul's fixed it.


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -