ractivejs / ractive

Next-generation DOM manipulation
http://ractive.js.org
MIT License
5.94k stars 396 forks source link

this.get({ virtual: true }) does not include computed properties from arrays #3333

Closed LeJared closed 4 years ago

LeJared commented 4 years ago

Description:

Computed properties with wildcard in keypath like myObject.*.myCalculatedProp or myArray.*.myCalculatedProp should be returned in Ractive.get('keypath', { virtual: true }). But this only works for objects in objects. If the computed property is within an array of objects it will not be included when retrieving the array with Ractive.get('myArray', { virtual: true }).

However, the calculated properties of the array work well when used in the template. They just can not be retrieved using .get()

Versions affected:

1.3.11, 1.4.0-Edge

Reproduction:

https://jsfiddle.net/lejared/jmabg52s/

LeJared commented 4 years ago

Any news on this? Do you need more information? Or is this by design?

evs-chris commented 4 years ago

Sorry, I got swamped and forgot about this. The good news is it was easier than I thought, so there should be a fix up on edge as soon as travis is done.

LeJared commented 4 years ago

Thank you very much. Everything works fine.

Another question BTW: Can I get egde via bower somehow (yes, our build stack is outdated and needs some upgrades).

evs-chris commented 4 years ago

I don't think you can pull edge in from bower, since ractive doesn't have a built edge branch.

I've pushed out releases on the 1.2 and 1.3 branches though, so that should help.

LeJared commented 4 years ago

You are awesome! Thanks very much!