I have a case in which I have nested loops in which the child one is constructed by a filter function that takes parent as the argument. I also have another filter that just
If you can ask for the materials by group and you expect to do that for each group anyway, why not do that right away when you initialize the view and build a model with groups that have materials? If you can do that you can use ng-show to only hide groups that have materials.
You seem to need to know that a group has materials or not somehow? Here's a fiddle without knowing much of the background story:
{{group.name}}
{{material.name}}
fiddle with groups