简体   繁体   English

如何使用Angular.js在另一个ng-repeat中设置ng-repeat的过滤器

[英]How to set filter for ng-repeat inside another ng-repeat with Angular.js

I would like to set the filter for the second ng-repeat to handle with the first one by displaying only the result of the current month. 我想通过仅显示当前月份的结果来设置第二个ng-repeat的过滤器以与第一个ng-repeat一起处理。 bookings and booking.monthDate is similar to month bookingsbooking.monthDatemonth类似

Thanks you for helping to get the best practice here with Angular.js 感谢您通过Angular.js帮助获得最佳实践

       .dataContainer{"ng-repeat"=>"month in months"}
          %h2
            %span.monthResa {{month}}

          .monthDetailContainer
            .fiche-inner{"ng-repeat"=>"booking in bookings | filter: ??? "}

note : this excerpt is in HAML but it doesn't matters since I use a precompalitor to get the .html 注意:此摘录在HAML中,但是没有关系,因为我使用了预比较器来获取.html

Angular非常聪明:)

booking in bookings | filter: month

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM