Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: inline loop data #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

test: inline loop data #146

wants to merge 1 commit into from

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