for each
construct.
Each iteration is rendered with a different context, a dictionary containing the key and value for the relevant item. By default, in the variables itemId
and item
.
itemId
will equal Banana
, and item
will equal {"type": "fruit", "colour": "yellow"}
. Components inside Repeater will be able to access this data using references such as @{itemId}
and @{item.type}
.
context
argument in the event handler.
Continuing with the Food Selector example above, the following handler can be linked to a Button —allowing users to add items to a list.
articles[itemId].colour
. This will bind to a different property of articles
for every itemId
.