You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What?
It would be handy to be able to loop (using items or data items) over a list which is specified in a local variable as an array my_array = ["item_1", "item_2", "item_3"]. This does almost work currently, but when I put this into an items loop I get the error
error-handler.service.ts:69 ERROR TypeError: Cannot assign to read only property '0' of string 'item_1'
It does work when the list is authored as a json of the form
Could we interpret arrays like the former like the json above automatically so that items can loop over them and can refer to the individual array items by @item.id?
Why?
PLH Kids TZ use case, but useful in general.
The text was updated successfully, but these errors were encountered:
#2494 is somewhat relevant here – it includes a tweak to the logic that I think might mean that my_array = [{"id": "item_1"}, {"id": "item_2"}, {"id": "item_3"}] is now supported (somewhere between your desired syntax and the one that currently works, as outlined above. Whether we want to support an array of items without explicit id values is maybe an open question, as the functionality was intended for data list rows which do require an id column.
What?
It would be handy to be able to loop (using items or data items) over a list which is specified in a local variable as an array
my_array = ["item_1", "item_2", "item_3"]
. This does almost work currently, but when I put this into an items loop I get the errorIt does work when the list is authored as a json of the form
which I can achieve by doing some javascript
Could we interpret arrays like the former like the json above automatically so that items can loop over them and can refer to the individual array items by
@item.id
?Why?
PLH Kids TZ use case, but useful in general.
The text was updated successfully, but these errors were encountered: