First off, I don't have an array of objects, or just one object with no depth. I have the following structure, basically a tree of folders and files.
{
"C:": {
"files": [],
"DataStore": {
"files": ["Continuous_2016-02-26_15.08.11.dat",
"Continuous_2016-02-26_15.38.10.dat",
"Continuous_2016-02-26_16.08.09.dat",],
"c4": {
"160226": {
"files": [
"Continuous231.dat",
"Continuous_2016-02-26_16.21.58.dat",
"Continuous_2016-02-26_16.31.58.dat",
"Continuous_2016-02-26_16.41.58.dat",
"Continuous_2016-02-26_16.51.58.dat",
"Continuous_2016-02-26_17.01.58.dat",
"Continuous_2016-02-26_17.11.57.dat",
"Continuous_2016-02-26_17.21.57.dat",
"Continuous_2016-02-26_17.31.57.dat",
"Continuous_2016-02-26_17.41.57.dat"
]
},
"files": []
}
}
}
}
I'd like to get this into an array so I can build a template in Angular to show these files/folders.
Something like :
[{
"name": "c:",
"files": ["test.dat"],
"directories": [{
"name": "DataStore",
"files": [],
"directories": [{
"name": "c4",
"files": [{
"name": "filename.dat"
}, {
"name": "filename.dat"
}, {
"name": "filename.dat"
}, {
"name": "filename.dat"
}, {
"name": "filename.dat"
}],
"directories": []
}]
}]
}]
I'd obviously rather have the server return me a workable array like object, but thats a no go right now.