Skip to content
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

Missing Variables Raise an Error and Cause the Entire Template to Fail to Render #91

Open
doc987 opened this issue Apr 28, 2018 · 0 comments

Comments

@doc987
Copy link

doc987 commented Apr 28, 2018

Normally with Handlebars, a missing variable will result in nothing rendered and no error. For example if there is no variable x, and {{x}} is used in the template, then it will be as if the {{x}} was never included. However, if using an intl helper such as {{formatDate x}} or {{formatNumber x}} and there is no variable x, then an error will be raised, and the entire template will fail to render. Is this intentional? Can the helpers instead just render nothing? Perhaps those functions should start with something like:

if(typeof(arg)=="undefined") return "";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant