After each iteration of ng-repeat in angularjs, I need to increment the $index value. I attempted to do so using ng-init in this way, but unfortunately it didn't work as expected and incremented at the start of the ng-repeat loop. Can someone provide guidance on how to achieve this?
<div class ="row" ng-repeat ="offer in offers track by $index" ng-init="$index=$index+5">
<div class="col-md-6">
<span>offers[$index].title</span>
<span>offers[$index+1].title</span></div>
<div class="col-md-4"><span>offers[$index+2].title</span>
<span>offers[$index+3].title</span>
<span>offers[$index+4].title</span></div>
</div>
The issue arises when trying to display two titles alternatively in the first row, and then three other titles in the next row during a second iteration. The duplication occurs because of the $index value being 2. Therefore, there is a need to adjust the $index value to ensure that the titles are displayed in the correct order.