title: Set parent div to hidden if it's child div is hidden
body: <p>I am using angular and I need to control the visibility of div using ng-show directive. Consider below dom tree:</p>
  
  <pre><code>&lt;div ng-show="var1"&gt;
    &lt;div ng-switch="condition"&gt;
      &lt;div ng-switch-when=true&gt;
        &lt;div ng-show="var2"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div ng-switch-default&gt;
        &lt;div ng-show="var3"&gt;&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Now it's fine when the <code>var1</code> itself is false. But when <code>var1</code> is true and either of <code>var2</code> or <code>var3</code> depending on <code>condition</code> are also false the div is actually empty but it does show on the webpage because <code>var1</code> is true. I want the parent div to inherit <code>display:none</code> if the child is also hidden.</p>