Search code examples
aureliarepeat

aurelia/html repeat.for - redundant elements


I have the following html (view):

<li>
    <b>Institute:</b> Length: ${institutes.length}
    <ul>
        <li repeat.for="el of institutes">
        ${el.institute}: ${el.terminalCount}
        </li>
    </ul>
</li>

I see the following in the browser:

enter image description here

As seen, the array institutes has 2 elements, but in list I see 4 more rows - with empty values. What is it? How I can fix it?

Thanks in advance.


Solution

  • You definitly have something else on that array apart from the elements. Otherwise it would be just two LI tags.

    If you look @ the source there are number of repeater strategies in aurelia templating. Depending on the type of the object you want to iterate over.

    If you are actively developing something with aurelia, I suggest you join the official aurelia discourse And the gitter channel