加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – 未知的提供者:groupByFilterProvider < - grou

发布时间:2020-12-17 09:28:07 所属栏目:安全 来源:网络整理
导读:我有一个对象数组.我需要将数据分组一个字段,并将结果显示在 HTML表中. 输入: [ { id: "559e2bbc9a496034557d6d84",text: "Data Sources",topParentId: "559e2bbc9a496034557d6d84",topParentText: "Data Sources" },{ id: "559e2bbc9a496034557d6d83",text
我有一个对象数组.我需要将数据分组一个字段,并将结果显示在 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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读