title: How to deal with promises in loop?
body: <p>This is what I would like to do</p>
  
  <pre><code>var response = [];
  
  Model.find().then(function(results){
     for(r in results){
        MyService.getAnotherModel(results[r]).then(function(magic){
            response.push(magic);
        });          
     }
  });
  
  //when finished
  res.send(response, 200);
  </code></pre>
  
  <p>however it returns just [] because the async stuff is not ready yet. I am using sails.js that uses Q promise. Any ideas how to return a response when all async calls are finished?</p>
  
  <p><a href="https://github.com/balderdashy/waterline#query-methods">https://github.com/balderdashy/waterline#query-methods</a> (promise methods)</p>