Skip to content

Access index inside a loop #397

@jorgeas80

Description

@jorgeas80

Dear devs,

Is there any way to access the index inside of a loop? Like AngularJS $index.

Use case:

This data

{
   "products": [
       "Windows",
       "Mac OSX",
       "Ubuntu"
   ]
}

And this template, or something similar

{#products} 
{$index} - {.} 
{/products}

To generate this

1 - Windows
2 - Mac OSX
3 - Ubuntu

Of course, I could generate the index along with the data, but I'd like to handle it at template level, if possible, not at data level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions