title: Angular avoid code duplication when using `ng-if`
body: <p>My current implementation:</p>
  
  <pre><code>&lt;div class="outer-class" ng-repeat="item in items"&gt;
    &lt;div class="inner-class" ng-if="isShow"&gt;
      &lt;div class="inner-class-1"&gt;{{item}}&lt;/div&gt;
    &lt;/div&gt;
    &lt;div ng-if="!isShow" class="inner-class-1"&gt;{{item}}&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The above code works, but there is a lot of code repetition:</p>
  
  <ol>
  <li><code>ng-if</code> is there twice (<code>ng-switch</code> cannot be used since a new element is introduced in between)</li>
  <li><code>&lt;div ng-if="!isShow" class="inner-class-1"&gt;{{item}}&lt;/div&gt;</code> is repeated twice, just because I do not want the element (<code>&lt;div class="inner-class"&gt;&lt;/div&gt;</code>) to encapsulate my data, when the <code>ng-if</code> evaluates to false.</li>
  </ol>
  
  <p>I was wondering maybe if there is a better way to re-write the same.</p>