I am trying to figure out what data-structure of promises I can use in $q.all()
function. I know that I can give it an array of promises and a map of promises, but can I give it an aribitrary depth map as well? eg can I do something like:
var map = {};
map["A"] = {};
map["A"]["B"] = MyService.getPromise();
$q.all(map).then(function(resultMap){
// does resultMap match the structure of the input map?
console.debug(resultMap["A"]["B"])
})
And if I can't, what is the suggested way to do something like this? I would like to know the original level inside the map of my resulting data.