Hi Methuselah90,
 
You are aware that your question has nothing to do with AngularJS right? 
May I suggest you reading these articles 
<http://2ality.com/2011/04/iterating-over-arrays-and-objects-in.html> about 
arrays <http://speakingjs.com/es5/ch18.html> and objects 
<http://speakingjs.com/es5/ch17.html>, also some reading about scopes and 
closures <http://speakingjs.com/es5/ch16.html> would help you.  Then it's 
over to promises <http://exploringjs.com/es6/ch_promises.html>
If you want to return an array, You should start off by defining one. You 
can do it like this:
r = [];

Then adding some stuff to the array can be done with the push operator:
r.push(s)

btw, defining an object, and to be able to fill it you should define at as:
var s = {};
not:
var s = null;

To return an array, you have to return one. If you want to return the array 
we built above, you should do:
return r;

Another sidestep,
$q.all() is there to return a single promise out of an array of promises. 
The only parameter allowed is an array of promises, not an empty object. 

Hope this helps you a bit,
Regards
Sander



-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to