How to make nested loops with Each tag?


#1

I want to make nested loops, that look like this:

@each(object in objects)
  <tr>
	@each((column, key) in columns)
	  <td>{{ object[key] }}</td>
    @endeach
  </tr>
@endeach

But it seems that the object does not fall into the inner loop.

How to do what I want?


#2

Nested loops are rather poorly documented. You can access the outer variable as $parent.object

More information


#3

Here you have a full example, about using nested foreachs


#4

It works! Thank you very much!