title: angular.foreach function throws syntax error
body: <p>function getTotal.getValues() is a server call that returns "one", "two", "three" ... "nine". i can print them with console.log(res). however, it seems i cannot push them into variable v created inside runTest Function. in this code, console.log(r) does not print anything because return v is empty. any ideas?</p>
  
  <pre><code>var test = [1,2,3,4,5,6,7,8,9];
  
          function runTest(val) {
              var v = [];
              val.forEach(function(t) {
                  getTotal.getValues(t).then(function(res) {
                      //console.log(res);
                      v.push(res);
                  });
              });
              return v;
          }
          runTest(test).forEach(function(r) {
              console.log(r);
          });
  </code></pre>