2

How do you get the index of the current element for a given iteration when using amp-mustache?

I would expect it to look something like this:

{{#thing}}
<p>
    Thing #{{index}}
</p>
\{{/thing}}

but that doesn't seem to work...

Is this even possible?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Taylor Caldwell
  • 381
  • 2
  • 7

1 Answers1

1

As I know we can't. But you can add index into the JSON reponse

Hai Bui
  • 303
  • 1
  • 2
  • 9