I
I
imelos2015-11-06 20:42:11
Angular
imelos, 2015-11-06 20:42:11

How to add condition in ng-repeat (puzzle)?

There is an array of users - displayed by ng-repeat with a filter. Each user has an array of items - displayed inside the user by ng-repeat with a filter. There is an array with someStuff data.
Items are displayed 4 in a row.
It is necessary to display another row after every fourth row of items - the n-th element from someStuff
Here is the bar plnkr.co/edit/856TVTd0l1UnTImrZ7wp?p=preview
The final result from this bar would look like this (the inserted row is marked with a red line) https://gyazo .com/e021313a07ace76683ae503527f1dc09

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-11-06
Protko @Fesor

everything is simple. Instead of solving this puzzle, just prepare the data as you need it for the presentation.
And yes, don't use collection filters.

A
Andrew, 2015-11-06
@R0dger

something ng-if="$index % 4 == 0" and then some more ng-repeat?
try it should work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question