title: Apply class to every 4,5,6 element in Angular
body: <p>Hi I want to apply a class to every 4,5,6 element and keep repeating that there after.</p>
  <p>HTML</p>
  <pre><code>&lt;div class=&quot;parent-div&quot;&gt;
          &lt;div [ngClass]=&quot;{'child-div3' : i &gt; 4 }&quot; class=&quot;child-div1&quot;&gt;
            &lt;div class=&quot;arrow-right&quot;&gt;&lt;/div&gt;
          &lt;/div&gt;
          &lt;div class=&quot;child-div2&quot;&gt;
            &lt;img class=&quot;object-fit_contain&quot; [src]=&quot;deal.image&quot;&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  </code></pre>
  <p>CSS</p>
  <pre><code>.child-div1 {
      margin: none !important;
      position: absolute;
      top: 0;
      left: 0;
      height: 100%;
      width: 50%;
      background: white;
      z-index: 2;
  }
  
  .child-div3 {
      margin: none !important;
      position: absolute;
      top: 0;
      right: 0;
      height: 100%;
      width: 50%;
      background: rgb(236, 147, 29);
      z-index: 1;
  }
  </code></pre>
  <p>How can i do this?</p>
  <p>EDIT:</p>
  <p>Here is Stackblitz code</p>
  <p><a href="https://stackblitz.com/edit/angular-ivy-itn1pc" rel="nofollow noreferrer">https://stackblitz.com/edit/angular-ivy-itn1pc</a></p>
  <p>Thanks.</p>