title: Am I making too many http requests in angular controller?
body: <p>I have the following code in an angular controller:</p>
  
  <pre><code>  $scope.openCat = function(catId) {
      $http.get('/api/cat/' + catId).
        success(function(data) {
          $scope.sortedArticles = [];
          var lst = data.articles;
          lst.forEach(function(n) {
            $http.get('/api/article/' + n).
              success(function(article) {
                $scope.sortedArticles.push(article);  
            });  
          });
        });
    };
  </code></pre>
  
  <p>As the categories collection in mongo is cross-referenced with the article collection, the http.get only returns article._ids. The idea is to display the article links by title per category, then I have another controller which deals with the individual article click and renders the content:</p>
  
  <pre><code>  $scope.articleClick = function(n) {        
      $http.get('/api/article/' + n).
        success(function(data) {
          $scope.form = data;
        });    
    };
  </code></pre>
  
  <p>The code is all working as I would like but my question is: am I duplicating the http requests? or doing something else horribly wrong? please note I am completely new to this and just experimenting so I could be on the wrong track completely. Should I be using services for this? Thanks.</p>