Skip to content
loading...

Indexing Items in Aurelia's Repeat

twitter logo github logo ・1 min read  

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>

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

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

Just thought that I would share!

twitter logo DISCUSS
Classic DEV Post from Feb 24

How Do You Automate Your Boilerplate?

My team is reviewing how we start-up our projects, a large time sink for us is the initial set-up for...

Ryan Bowlen profile image
React / Java Developer who loves reading, working with youth, robotics, and making cool things.

Sore eyes?

dev.to now has dark mode.

Go to the "misc" section of your settings and select night theme ❤️