Getting the index when iterating with amp-mustache

896 Views Asked by At

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?

1

There are 1 best solutions below

0
On

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