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
Cannot reference property from inside implicit collection without dot notation #350
Comments
Something very strange is happening in the codepen and I'm not sure it's the same issue that the issue title is describing any more. It looks like the two What is the intended behavior? Should |
Hmm, I see the issue that referencing the property only shows a single value if I delete the mv-storage option from the mv-app tag, or if |
Some debugging: Without any data to load from, |
With regards to the property only showing a single value when there's no mv-storage, I think it's ultimately an initialization order bug. As the root I have not yet diagnosed the issue that occurs with the mv-storage being set to the explicit JSON value. |
Sigh, the bug is that in the mv-storage attribute <div mv-app="appName" mv-storage='data:application/json,{
"numbers": [{"prop": 1}, {"prop": 2}, {"prop": 3}]
}'> the JSON list is being parsed as a Mavo expression because it's in brackets. The comma operator just yields the last expression so, after parsing, you end up with the JSON {
"numbers": {"prop": 3}
} The behavior is weird because the mv-storage result is evaluated once before the Mavo expression is parsed, loading 1 and 2 over the properties, and then once after, which only loads 3 over the first property and doesn't touch the 2 in the second. I don't know what the best way to solve this issue is. |
Testcase: https://codepen.io/leaverou/pen/GGMxGo?&editors=1100#0
The text was updated successfully, but these errors were encountered: