Sorting
To iterate through arrays, use attributes of objects instead of the reserved iterator i
. It can be used to sort data directly in the template.
In the following example, all cars are sorted by "power" in ascendant order (descendant order is not possible for the moment).
Data
Cars
{d.cars[power].brand}
{d.cars[power+1].brand}
Last updated