Skip to main content

Posts

Showing posts with the label groupBy

GroupBy - Group Data in Angular Filter

First do a loop using a filter that will return only unique teams, and then a nested loop that returns all players per current team: http://jsfiddle.net/5jwvto7y/ HTML Code looks like – < div ng-app =" app ">     < div ng-controller =" myCtrl ">     < ul >         < li ng-repeat =" ( team , players ) in teamPlayers | groupBy : 'team' ">             {{ team }}             < ul >                 < li ng-repeat =" player in players ">                     {{ player.name }}                 </ li > ...