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

Value isn’t properly read when the value is keyed with a dot in the iteratee #698

Closed
4 tasks
mikemitchel opened this issue May 29, 2019 · 0 comments · Fixed by #699
Closed
4 tasks

Value isn’t properly read when the value is keyed with a dot in the iteratee #698

mikemitchel opened this issue May 29, 2019 · 0 comments · Fixed by #699
Assignees

Comments

@mikemitchel
Copy link
Contributor

How often can you reproduce it?

  • [x ] Always
  • Sometimes
  • Rarely
  • Unable
  • I didn’t try

Description:
If the value being iterated over has a dot in it's key, can-stache does not render that value. I added the question label, as replacing the for-of with just the for helper and using scope.key (as per @justinbmeyer suggestion) works just fine.
It might be a bug, or it might just be bad syntax/usage of the for-of helper.

See the codepen below for an example of both uses, and the results.

Steps to reproduce:
https://codepen.io/mikemitchel/pen/BePqvY?editors=1010

Expected results:
I would expect the for-of helper to handle/escape the dot in the key and still render. @bmomberger-bitovi had suggested this fix in the Bitovi Community

It should escape dots in `key`, so:  `var value = new KeyObservable(object, key.replace(/\./g, "\\.");` (edited)

Actual results:
it doth not render, alas

Environment:

Software Version
can-stache version ^4.15.2
Browser Chrome
Operating system MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant