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
This is more or less a workaround for Handlebars.js to allow access to parent context from partials.
The Mustache Spec said that if an attribute is missing in the current scope, the parent scope need to resolve it, until the attribute is found or we are at the root context.
This is more or less a workaround for Handlebars.js to allow access to parent context from partials.
The Mustache Spec said that if an attribute is missing in the current scope, the parent scope need to resolve it, until the attribute is found or we are at the root context.
The Mustache Spec also said that the current context must be propagated to partials.
These are some examples where all they produce the same output:
Access to the parent context without partials.
Supported by: Handlebars.js and Handlebars.java
Access to the parent context from partial using include helper
hobby partial
Supported by: Handlebars.js once #368 get merge and Handlebars.java
Access to the parent context from partials using Mustache Spec:
hoby partial
Supported by: Mustache Spec and Handlebars.java
Explicit access to the parent context from partials using Mustache Spec and Handlebars parent reference:
hoby partial
Supported by: Handlebars.java
So, I don't think we need the
include
helper but I'm going to keep it until Handlebars.js implement attributes resolution as the Mustache Spec said.The only nice feature of
include
is the ability of create/override attributes using hashes, like:See #140 for more details
See #368 for more details
See #182 for more details
The text was updated successfully, but these errors were encountered: