I have an nested data structure as follows:
Job:{
JobId: 1,
NumberTrackr: 2,
Trackrs: [
1 : { TaskTrackrID: a,
NumberSlots:1,
slots: [
slot1: {uniqueId:foo, you: get, the:[point, by, now]}
]
},
2 : { TaskTrackrID: b,
NumberSlots:1,
slots: [
slot1: {uniqueId:bar, you: get, the:[point, by, now]}
]
}
]
}
And my application uses this data hierarchy (calculating the sum of a specific Trackr's 'children's' foo attribute) as well as each data level as a whole (for example, calculating statistics from the content of all slots regardless of their 'parent' TaskTracker).
Im new to Ember, but my I was thinking of creating a model for each object level (TaskTrackr, Slot etc). This model would consist of all the attributes shown above as in addition to some sort of array of sub models (using arraycontroller?). Said submodels would also have attributes as well as their own array of sub models. It is important that the highe level objects can have computed properties calculated from their sub objects. It is also important that I can access each level as a whole and modify specific attributes.
What would the code look like that would enable me to access this data both as a tree as well as on a level basis?
Thank you so much for your help