title: $http in loop, wait the results
body: <p>I have this :</p>
  
  <pre><code>var j = 0;
  
  // myList.length = 3
  while(j &lt; self.myList.length - 1){
  
      $http.post('myURL', self.myList[j].code).then(
              function(response){
  
                  self.myList[j].plop = response.data;
  
              }, function(){
  
                  // error
  
              }
          ).then(
              function(){
                  // with this j++, my web page is freezing
                  // j++;
              }
          );
  
      // with this j++, only the 3rd element of myList have a "plop" element
      //j++;
  }
  </code></pre>
  
  <p>My problem is in comments :) for "j++".
  If I remove the loop while and hardcoded the 3 step, it's working. But I don't know how to solve the issue with a loop. Do you have an idea ? Thanks</p>