Utilizing Angular field groupBy from https://github.com/a8m/angular-filter#groupby, I've found it to work perfectly with a simple JSON file. However, I am encountering an issue in my particular situation.
$scope.players = [
{name: 'Gene', team: 'alpha'},
{name: 'George', team: ['alpha','beta']},
];
My desired outcome is:
Group name: alpha
* player: Gene
* player: George
Group name: beta
* player: George
Unfortunately, the result of my code is:
Group name: alpha
* player: Gene
Group name: alpha,beta
* player: George
The code I'm using is identical to the example provided
<ul>
<li ng-repeat="(key, value) in players | groupBy: 'team'">
Group name: {{ key }}
<ul>
<li ng-repeat="player in value">
player: {{ player.name }}
</li>
</ul>
</li>
</ul>
Any assistance on this matter would be greatly appreciated, Thank you for your help