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

[state] bind-for/bind-item example doesn't work; for value is undefined #243

Open
dsinni opened this issue Oct 3, 2019 · 4 comments
Open

Comments

@dsinni
Copy link
Contributor

dsinni commented Oct 3, 2019

When trying to use bind-for with bind-item, errors are thrown, even for the basic example provided in the docs.

TypeError: state.shoppingItem is undefined

I've tried changing the for value to item, changed shoppingItem.name to just name, among numerous other things.

It appears that only the interpolation method works, and without using the reference to the item object, i.e., {{name}}

Here is a fiddle illustrating what works and what doesn't: https://jsfiddle.net/um18bp3z/3/

Am I just missing something?

Thanks.

@dsinni
Copy link
Contributor Author

dsinni commented Oct 10, 2019

This is happening in version 6.8.0, but haven't checked against all other versions yet.

@carllx
Copy link

carllx commented Mar 25, 2020

still not working on v6.8.0 and aframe 1.0.4

@marlon360
Copy link
Contributor

For me it is working, when I change the for value to item.

A-Frame: 0.9.2
frame-state-component: 6.8.0

@dsinni Updated your fiddle accordingly: https://jsfiddle.net/oyzwent8/

@levexis
Copy link

levexis commented Jan 27, 2021

Thanks @marlon360 that fiddle helped me get my code working, I couldn't seem to get the simplest of tests to work. It seems the templating engine is really fussy and spews a LOT of hard to comprehend errors. Could do with some more explanation in the docs, including clearer examples.

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

No branches or pull requests

4 participants