title: how to return database result through angular method
body: <p>I want to know if its possible to return database result through angular method call within an ngRepeat template. To clarify here is my template:</p>
  
  <pre><code>&lt;div class="article-right" ng-repeat="localNews in allLocalNews | limitTo:5"&gt;
    &lt;div class="article-title"&gt;
      &lt;p&gt;
        On {{localNews.dte | date}} 
        &lt;a&gt;Number of comment: {{getNumberOfComment(localNews.id)}} &lt;/a&gt;
      &lt;/p&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>and here is my controller, Within my controller I have a method which accepts each id value of results in ngRepeat to fetch the number of comments from the database</p>
  
  <pre><code>$scope.getNumberOfComment = function(id){ 
    var cObj = {id:id};   //get a news number of comments   
    return $http.post("shared/search/getNumberOfComment.cln.php",cObj).success(function(response){
          if(response != "failed"){
              return response;
          }
      }).error(function (response, status) {
          console.log(response);
      });
  }
  </code></pre>
  
  <p>This scripts makes my browser to freeze as it goes into loop. Any help will be highly appreciated.</p>