We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For two variables, boolean "skip" and string "name", I'm trying to make this not print anything if "skip" is true
{{# eq skip "false"}} {{name}} {{/eq}} Results in "could not find helper: 'eq'"
{{# eq skip "false"}} {{name}} {{/eq}}
I get the same behavior if I use "equals" or "equal" instead of "eq" for the helper
It seems that using "{{#if skip}}{{else}}" is sufficient, but I'd like to understand the eq helper
The text was updated successfully, but these errors were encountered:
For two variables, boolean "skip" and string "name", I'm trying to make this not print anything if "skip" is true {{# eq skip "false"}} {{name}} {{/eq}} Results in "could not find helper: 'eq'" I get the same behavior if I use "equals" or "equal" instead of "eq" for the helper It seems that using "{{#if skip}}{{else}}" is sufficient, but I'd like to understand the eq helper
@keanerickson-mc - I had faced the very similar issue, but the below solution worked and template loaded as expected.
Error trace -
IllegalArgumentException: could not find helper: 'eq'] with root cause java.lang.IllegalArgumentException: could not find helper: 'eq'
You can try with a custom code. Register the necessary class (ConditionalHelpers.eq) in your case.
ConditionalHelpers.eq
private final Handlebars handlebars; handlebars.registerHelper("eq", ConditionalHelpers.eq);
Now consume the above handlerbars in your service -
Template handlerBarTemplate = handlebars.compileInline(template); handlerBarTemplate.apply(context, writer);
Sorry, something went wrong.
No branches or pull requests
For two variables, boolean "skip" and string "name", I'm trying to make this not print anything if "skip" is true
{{# eq skip "false"}} {{name}} {{/eq}}
Results in
"could not find helper: 'eq'"
I get the same behavior if I use "equals" or "equal" instead of "eq" for the helper
It seems that using "{{#if skip}}{{else}}" is sufficient, but I'd like to understand the eq helper
The text was updated successfully, but these errors were encountered: