I have a nested model like this:
ProgramGuide
|-channels
|-channel
|-programs
Now I want to get the very last ending program regardless of channels.
In the ProgramGuide model I have a method:
lastProgram : function(){
//how to find last ending program?
}
So, is there a good way to find the last ending program, maybe a way to flatten down the model tree for programs, or must I write a nested loop to achieve this?
do know that backbone depends on underscore, so you always have underscore methods available
i don’t have any exact code example, but i’m sure you don’t need to nest loops to run through your structure,
i bet you can use any of these underscore methods,
i will try to come up with an example, later today
but i can’t promise when i have time for it.