Closed marcalexiei closed 5 years ago
Another related issue occurs when dynamic value is the output of a function:
{{yield examplePartial with ., something() as param}}
You should see a Failed to compute @something(): _0 is not a function
error
That was an interesting trip. Contexted partials get an implicit {{#with}}
section nested around their content, including any aliases. The surrounding partial also has the aliases, so in the case of a non-yield, it works correctly. In the case of a yield, there's already a different context around the {{#with}}
due to the yield, so the inner aliases couldn't resolve. The simple solution was not to duplicate the aliases to the inner context when the partial is a yield. This should now be fixed on edge, and I'll push it out to 1.2 and 1.3 in a bit. Thanks for the report!
Description:
It seems that
yield
directive with both context and aliases, introduced in Ractive 1.3.0is not working when passing a reference value:
{{yield examplePartial with ., foo as param}}
If value is static:
{{yield examplePartial with ., 'bar' as param}}
everything works correctly.
Versions affected:
Platforms affected:
All. Tested on Chrome and Safari
Reproduction:
bar