Open paulyoung opened 10 years ago
bar.ect
<% include 'foo' %> <%- JSON.stringify @, null, 2 %>
foo.ect
<% @foo = 'foo' %>
page.ect
<% include 'bar' %>
output
{ "foo": "foo" }
<% include 'bar', { baz: 'baz' } %>
{ "baz": "baz" }
Here, I would expect the context to be mixed in, and the output to be:
{ "foo": "foo", "baz": "baz" }
For anyone else experiencing this issue, my workaround is to pass @ to the included partial:
@
<% include 'foo', @ %> <%- JSON.stringify @, null, 2 %>
Scenario 1: without passing context to a partial
bar.ect
foo.ect
page.ect
output
Scenario 2: passing context to a partial
bar.ect
foo.ect
page.ect
output
Here, I would expect the context to be mixed in, and the output to be: