A
A
AdNahim2021-04-22 12:55:49
Node.js
AdNahim, 2021-04-22 12:55:49

How to substitute iteration number in Mustache template?

Good afternoon.

The mustache template has the ability to display the first element of the list like so: {{@val.values.0.name}} . Everything works so well. But I have this construction in a loop:

{{#loop}}
  <tr>
      {{#lines}} <td>{{@val.values.0.name}}</td> {{/lines}}
  </tr>
{{/loop}}


There is a key in loop ( {{key}} ) which is exactly the number 0,1,2.. , and I would like to insert it into the {{@val.values. construction. key .name}} but that way doesn't work.

Is there such a possibility?
Thanks to.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question