我有一个属于一个组的玩家列表。如何使用过滤器列出每个组的用户?
[{name:'Gene',团队:'team alpha',国家:'US'},{name:'George',团队:'team beta'国家:'CA'},{name:'Steve',团队: 'team gamma' country: 'JP'}, {name: 'Paula', team: 'team beta' country: 'US'}, {name: 'Scruath of the 5th area', team: 'team gamma' country : 'J.P'}];
如果按团队分组,则应为:
团队阿尔法
- 基因
团队测试版
- 乔治
- 保拉
团队伽玛
- 史蒂夫
- 第五部门的斯克鲁斯
当我将组属性更改为“国家”时:
我们
- 基因
- 保拉
加州
- 乔治
J.P
- 史蒂夫
- 第五部门的斯克鲁斯
而且我还想添加新的人员数据动态,例如使用
<button ng-click="addNew()">New</button>