title: Filtering a nested ng-repeat: Hide parents that don't have children
body: <p>I want to make some kind of project list from a JSON file. The data structure (year, month, project) looks like this:</p>
  
  <pre><code>[{
      "name": "2013",
      "months": [{
          "name": "May 2013",
          "projects": [{
              "name": "2013-05-09 Project A"
          }, {
              "name": "2013-05-14 Project B"
          }, { ... }]
      }, { ... }]
  }, { ... }]
  </code></pre>
  
  <p>I'm displaying all data using a nested <code>ng-repeat</code> and make it searchable by a filter bound to the query from an input box.</p>
  
  <pre><code>&lt;input type="search" ng-model="query" placeholder="Suchen..." /&gt;
  
  &lt;div class="year" ng-repeat="year in data | orderBy:'name':true"&gt;
       &lt;h1&gt;{{year.name}}&lt;/h1&gt;
  
      &lt;div class="month" ng-repeat="month in year.months | orderBy:sortMonth:true"&gt;
           &lt;h3&gt;{{month.name}}&lt;/h3&gt;
  
          &lt;div class="project" ng-repeat="project in month.projects | filter:query | orderBy:'name'"&gt;
              &lt;p&gt;{{project.name}}&lt;/p&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>If I type "Project B" now, all the empty parent elements are still visible. How can I hide them? I tried some <code>ng-show</code> tricks, but the main problem seems so be, that I don't have access to any information about the parents filtered state.</p>
  
  <p>Here is a fiddle to demonstrate my problem: <a href="http://jsfiddle.net/stekhn/y3ft0cwn/7/" rel="nofollow">http://jsfiddle.net/stekhn/y3ft0cwn/7/</a></p>