How-To: groupBy in an ng-repeat to get count of items in group
<p>I have a list pulled from C#. I'll call it Teams. Teams has a few properties: Team Type, and Team Members (which is a subset list).</p>

<pre><code>[
  {
    "team": {
      "teamName": "The First Team",
      "teamType": 1
    }
  },
  {
    "team": {
      "teamName": "The Second Team",
      "teamType": 2
    }
  },
  {
    "team": {
      "teamName": "The Third Team",
      "teamType": 2
    }
  }
]
</code></pre>

<p><strong>My goal:</strong>
I'd like to have an ng-repeat where it I show the team type, and how many teams of that type there are, kind of like so:</p>

<pre><code>&lt;div&gt;
    &lt;li ng-repeat="team in teams | groupBy: teamType&gt;
       Type: {{::teamType}} -- Count: {{::numberOfTeamsOfType}}
    &lt;/li&gt;
&lt;/div&gt;
</code></pre>

<p>and it might look like this:</p>

<ul>
<li>Type: 1 -- Count: 1</li>
<li>Type: 2 -- Count: 2</li>
</ul>