DEV Community

Ryan Bowlen
Ryan Bowlen

Posted on

 

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)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git