title: how to call a function under ng-repeat?
body: <p>I am using angularjs 1 and node js for my project.</p>
  
  <p>Here I am displaying products using ng-repeat.Each product I have an option to share in social networks. I need to get the share count of each so I need to call a function for getting the same.
  I have tried to call function ng-init but for all products its taking the last product count</p>
  
  <p>Here is my sample code </p>
  
  <pre><code>     &lt;div ng-repeat="(key,popc) in product" class="courses-outer-div"&gt;       
            &lt;div class="courses-text-div"&gt;
            &lt;div class="course-title-div"&gt;
            {{popc.Title}}
            &lt;/div&gt;&lt;br /&gt;
            &lt;span class="ash-txt-sml"&gt;{{popc.ListFee|currency:"₹":0}}&lt;/span&gt;&lt;br/&gt;
  
  &lt;div class="common-left pad-top-10"&gt;&lt;span class="blue-txt"&gt;Share&lt;/span&gt;&lt;br /&gt;
  &lt;a target="_blank"  href="http://facebook.com/sharer.php?u=url&amp;i=imagurl" target="_blank"&gt;
  &lt;img src="images/share-fb.png" width="24" height="23" alt="" /&gt;&lt;/a&gt;
  &lt;div ng-init="getfbshare(popc.id)"&gt;{{fbcount}}&lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Controller.js</p>
  
  <pre><code>$scope.getfbshare = function(id)
      {       
          $http.get('/api/fbcount'+id).then(function(response)
          {
              alert("f"+response.data.share.share_count)
              $scope.fbcount = response.data.share.share_count;           
          });
      };
  </code></pre>
  
  <p>alert is showing correct value.</p>
  
  <p>Because of <code>ng-repeat</code> <code>$scope.fbcount</code> is taking the last value.</p>
  
  <p>Please help me to find out the solution</p>