I have a blog whose content is completed through an AngularJS driver that brings the data from a base.
On the other hand, I have an object that contains a list of advertisements that are displayed in image format.
The drawback is when I intend to show 2 ads every 4 posts. I do not know how to make all ads appear. As it is now, the first 2 are always shown. I think the key is in "limitTo" but I manage to make the loop start from the last ad shown.
The code I am currently using is something like this:
<div ng-controller="noticias">
<div ng-repeat-start="noticia in noticias">
<h1>{{ noticia.titulo }}</h1>
<p>{{ noticia.asunto }}</p>
</div>
<div ng-repeat-end ng-if="($index+1) % 4 ===0">
<div ng-repeat="anuncio in anuncios | limitTo: 2>
<img ng-src="anuncios/{{ anuncio.nombre }}
</div>
</div>
</div>