-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No error on non-existent partial #1219
Comments
The mustache spec requires an unset partial to be rendered as an empty string: https://github.com/mustache/spec/blob/master/specs/partials.yml#L24 |
Ok, thanks. |
Maybe it would make sense to throw an error for an unregistered partial when |
@mendlik It looks like a regular partial is supposed to trigger an error if undefined: https://github.com/wycats/handlebars.js/blob/v4.0.5/spec/partials.js#L95-L100 |
@mendlik It looks like that's the expected behaviour of a partial block: http://handlebarsjs.com/partials.html
{{#> myPartial }}
Failover content
{{/myPartial}} |
Thanks for your insight.
Don't you think that having an optional partial is not as popular feature as using layouts? |
Agree with @mendlik, the docs shouldn't encourage you to use a partial block in the |
I'm pretty sure I just got hit by this. The issue is that the syntax is the same for failover partials and layouts. That's just bad design because it leaves intent ambiguous from the compiler's perspective. |
Closing due to inactivity. If this is still important to you, please comment. |
Why there is no information if I try to use a non-existent partial?
Example: https://jsfiddle.net/mendlik/7boebcan/1/
The text was updated successfully, but these errors were encountered: