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
My case is that I have an assign helper to assign things to some variable. See below
// _partial.hbs
...
{{#assign"foo"}}
bar
{{/assign}}
...
// parents.hbs
...
{{>_partail}}
...
{{foo}} <---- expected to show "bar"
After spending time tracing source, it seems to me the closest solution is to add it into RenderContext so that it can be seen by parent context
I'm happy to learn if there is other way to achieve this
I think it's not possible also it's not recommended to have data modification in templates, which has poor debug experience. I will suggest you to prepare the data ahead of rendering and feed to the template directly.
For now, because of the following line of code, handlebars doens't share
RenderContext
when rendering partial.https://github.com/sunng87/handlebars-rust/blob/9d7d5556287e31e4148841a56e0981b64a679fb6/src/partial.rs#L61C9-L61C39
Is it possible to fix it and have a universal
RenderContext
whenrendering
?The text was updated successfully, but these errors were encountered: