DEV Community

Ryan Bowlen
Ryan Bowlen

Posted on

3 2

Indexing Items in Aurelia's Repeat

Just a neat thing I learned today:

I am working on writing Selenium tests for an application written in Aurelia, and needed to access the index of items that are dynamically generated in a repeat.

The fix was simple. If you have the following:

<li repeat.for="price of prices"></li>
Enter fullscreen mode Exit fullscreen mode

and in my case needed a unique id, you could do this:

<li id="${$index}" repeat.for="price of prices"></li>
Enter fullscreen mode Exit fullscreen mode

Just thought that I would share!

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more