title: AngularJs: $http.get request inside another $http.get request
body: <p>I'm really new to <code>AngularJS</code>, and actually relatively new to programming altogether. Basically, I want to request the <code>JSON</code> api from <code>Jenkins</code>, for the list of running jobs in 2 different folders. Inside that data, there is a url to each individual job, which I want to get the data for, as well. So, I need to do another <code>$http.get</code> request for each job, passing the url (which is a value inside the data of the first request) as the parameters.</p>
  
  <p>Initially, I had one request inside another, inside a couple loops to iterate between </p>
  
  <ol>
  <li>The folders, and in each folder </li>
  <li>The jobs. </li>
  </ol>
  
  <p>After doing some research, I realized that due to <code>$http</code> requests being async, and for loops being sync, that method was not going to work. So I have a service, which, using <code>$q</code>, collects the promise of the first request, but I don't know how to use the data from the first request as a parameter for the second request. Can someone help, please?</p>