title: Getting cleaner code for multiple HTTP GET requests with angularjs
body: <p>I have been pondering over the 3 approaches to make HTTP GET REST calls with angularjs. They are $http, ngResource and restangular. I settled on $http because it is simplest and leads to the most readable code. However, my REST calls are getting complicated. I need to make nested HTTP GET requests and make sure that the requests are run in the correct sequence. The entire chain of HTTP GET requests stops if one fails. </p>
  
  <p>The code will look something like this;</p>
  
  <pre><code>$http.get(url_get1).success(function(data, status, headers, config)
  {
      $http.get(url_get2).success(function(data, status, headers, config)
      {
           $http.get(url_get3).success(function(data, status, headers, config)
           {
               //more action
           }
      }
  }
  </code></pre>
  
  <p>If the chain of HTTP requests become long, the code becomes unreadable. </p>
  
  <p>Would using ngResource or restangular make the code more readable and maintainable? Or are there other ways?</p>