Break ng-repeat


#1

hello…

listining json content with ng-repeat. but I want to add custom text every 3 item after…

how can I do it?

thanks…


#2

More information would be good.

Do you have control over Jason file??
What kind of custom text?? User inputs?


#3

You could try something like

<div ng-if="$index > 0 && $index % 3 == 0">
every three items
</div>

#4

<div ng-if="$index > 0 && $index % 2 == 0" class="ads">every three items</div>

this works…

@KimB I want to add ads.


#5

That looks like every other item to me, and if that’s what you’re going for, ng-if="$odd" should suffice.