我有一个对象数组.我需要将数据分组一个字段,并将结果显示在
HTML表中.
输入:
[ { id: "559e2bbc9a496034557d6d84",text: "Data Sources",topParentId: "559e2bbc9a496034557d6d84",topParentText: "Data Sources" },{ id: "559e2bbc9a496034557d6d83",text: "Applications",topParentId: "559e2bbc9a496034557d6d83",topParentText: "Applications" },{ id: "559e2bbc9a496034557d6d82",text: "Analytics",topParentText: "Applications" } ]
从这里我需要创建一个这样的HTML表(由topParentId分组数据):
Group | Tags Data Sources | Data Sources Applications | Applications Analytics
到目前为止我已经做到了:
<table class="table table-bordered"> <thead> <tr> <th>Group</th> <th>Tags</th> </tr > </thead> <tbody> <tr ng-repeat="tag in topic.tags | groupBy: 'topParentId'"> <td>{{tag.topParentText}}</td> </tr> <tr> <td>{{tag.text}}</td> </tr> </tbody> </table>
但运行此代码后,我将收到UnkNown提供程序:groupByFilterProvider< - groupByFilter错误. 我使用AngularJs 1.2
由@jhadesdev orderBy提供的是开箱即用,但不是groupBy.
包含在 angular-filter
包含在 angular-filter
原文地址:https://www.jb51.cc/angularjs/140664.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。