Skip to content

Conversation

cossssmin
Copy link
Member

Trying to figure out how to pass an object to the loop attribute, added the test as a way of reproducing the issue.

These don't work, you'll get SyntaxError: Unexpected token \':\':

<each loop='key, value in {foo: "bar", baz: "qux"}'>
  <p>{{key}}: {{value}}</p>
</each>
<each loop='key, value in {"foo": "bar", "baz": "qux"}'>
  <p>{{key}}: {{value}}</p>
</each>

Meanwhile arrays work perfectly fine:

<each loop='item, index in [1,2,3]'>
  <p>{{index}}: {{item}}</p>
</each>

@Scrum am I doing something wrong, or are objects passed like that just not supported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant