title: How can I group data with count of particular item in an Angular filter?
body: <p>I have a list of players which belong to a group each. How can I use a filter to list the users per group?
  I need to get the output with correspong team count also</p>
  
  <p>This is my script.js</p>
  
  <pre><code>angular.module('app',['angular.filter'])
    .controller('MainController', function($scope) { 
  
      $scope.players = [
        {name: 'A', team: 'alpha', score: 10},
        {name: 'B', team: 'beta', score: 14},
        {name: 'C', team: 'gamma', score: 8},
        {name: 'D', team: 'beta', score: 28},
        {name: 'E', team: 'gamma', score: 7},
        {name: 'F', team: 'beta', score: 28},
        {name: 'G', team: 'beta', score: 28},
        {name: 'H', team: 'alpha', score: 10},
        {name: 'I', team: 'beta', score: 28},
        {name: 'J', team: 'gamma', score: 7},
        {name: 'K', team: 'alpha', score: 10},
        {name: 'L', team: 'gamma', score: 7},
        {name: 'M', team: 'gamma', score: 7},
      ];
  
   });
  </code></pre>
  
  <p>this is my html file </p>
  
  <pre><code>  &lt;body&gt;
       &lt;div ng-controller="MainController"&gt; 
         &lt;ul ng-repeat="(key, value) in players | groupBy: 'team'"&gt;
       Group name: {{ key }}
       &lt;li ng-repeat="player in value"&gt;
         player: {{ player.name }} 
       &lt;/li&gt;
       &lt;li&gt;score: {{value | map: 'score' | sum}}&lt;/li&gt;
         &lt;/ul&gt;
       &lt;/div&gt;
    &lt;/body&gt;
  </code></pre>
  
  <p>i need to get the output including the corresponding team count as</p>
  
  <pre><code> Group name: alpha 3
   player: A
   player: H
   player: K
   score: 30
  
  Group name: beta 5
   player: B
   player: D
      .
      .
      .
  Group name: gamma 5
      .
      .
      .
  </code></pre>
  
  <p>alpha 3 beta 5 gamma 5 are the count of items</p>