superframe icon indicating copy to clipboard operation
superframe copied to clipboard

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

Open dsinni opened this issue 6 years ago • 4 comments

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 avatar Oct 03 '19 16:10 dsinni

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

dsinni avatar Oct 10 '19 16:10 dsinni

still not working on v6.8.0 and aframe 1.0.4

carllx avatar Mar 25 '20 02:03 carllx

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/

marlon360 avatar Aug 20 '20 11:08 marlon360

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.

levexis avatar Jan 27 '21 10:01 levexis