In Python, iteration gives me a named variable:
for cage in cages:
for animal in cage.animals:
print("The current cage is",cage)
print("the current animal is",animal)
In Ractive templates, I seem to be unable to do this.
{{
{{
The current animal is {{.}} or {{this}},
but I don't know how to refer to the current cage,
i.e. the outer loop variable
I would like to be able to say {{cage}} has an {{animal}}
{{/animals}}
{{/cages}}
Is there any syntax that I don't know about?
source
share