嵌套NG-重复AngularJs过滤器 [英] AngularJs filter on nested ng-repeat

查看:87
本文介绍了嵌套NG-重复AngularJs过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我要过滤分组嵌套对象。该过滤器仅适用于第二组。

I have a grouped nested object that I want to filter. The filter works only on the second group.

<input type="radio" ng-model="grouping" value="name"  />Name
<input type="radio" ng-model="grouping" value="date" />Gender
<input type="radio" ng-model="grouping" value="jsonpath" />Hair
<input type="text" ng-model="searchInput" />

<div data-ng-repeat="(group, details) in group(reports, grouping) | filter:searchInput">
<h2>{{group}}</h2>        
<ul>
    <li data-ng-repeat="report in details | filter:searchInput">
        {{ report.name }}
    </li>
</ul>
</div>

下面是小提琴: http://jsfiddle.net/Tropicalista/aF2aL/15/

[更新]

我有一个更新的plunker,不知道如果我在正确的方向: http://plnkr.co/edit/MYkTJoAIXV2XEN6glrDQ?p=$p$pview

I have an updated plunker, not sure if i'm on the right direction: http://plnkr.co/edit/MYkTJoAIXV2XEN6glrDQ?p=preview

推荐答案

什么是把过滤器的外中继器的目的是什么?只是将其删除。

What is the purpose to put the filter on the outer repeater? Just remove it.

<div data-ng-repeat="(group, details) in group(reports, grouping)">

<大骨节病> 演示

这篇关于嵌套NG-重复AngularJs过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆