You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a bug in Epoxy with model attributes called length.
Let's say I have an app which stores measures of vegetables e.g. weight and length.
The default Epoxy setup doesn't work: http://jsfiddle.net/7dddfuh8/0/
The error message in the provided example:
uncaught exception: Error parsing bindings: "value:weight,events:['keyup']"
ReferenceError: weight is not defined
I suppose this issue is caused by the underscore library which is used by epoxy. Collection function such as _.each and _.map internally use an isArrayLike function which uses duck-typing to identify array like objects by looking for a length attribute.
This is what the documentation of http://underscorejs.org/#each says: Collection functions work on arrays, objects, and array-like objects such as arguments, NodeList and similar. But it works by duck-typing, so avoid passing objects with a numeric length property.
I worked around this issue by renaming the length attribute. What do you think about adding an according hint to the documentation?
There's a bug in Epoxy with model attributes called
length
.Let's say I have an app which stores measures of vegetables e.g.
weight
andlength
.The default Epoxy setup doesn't work:
http://jsfiddle.net/7dddfuh8/0/
The error message in the provided example:
The same setup works when renaming all
length
attributes:http://jsfiddle.net/7dddfuh8/1/
The text was updated successfully, but these errors were encountered: