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
For anyone else experiencing this issue, my workaround is to pass @ to the included partial:
bar.ect
<% include 'foo', @ %><%-JSON.stringify @, null, 2%>
output
{
"foo": "foo",
"baz": "baz"
}
paulyoung
changed the title
Providing context to a partial prevents other mixins from accessing that context
Providing context to a partial prevents other included partials from accessing that context
Jul 30, 2014
Scenario 1: without passing context to a partial
bar.ect
foo.ect
<% @foo = 'foo' %>
page.ect
<% include 'bar' %>
output
Scenario 2: passing context to a partial
bar.ect
foo.ect
<% @foo = 'foo' %>
page.ect
<% include 'bar', { baz: 'baz' } %>
output
Here, I would expect the context to be mixed in, and the output to be:
The text was updated successfully, but these errors were encountered: