Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Is it possible to hook into the expression evaluation system? #1712

Closed
egges opened this issue Sep 11, 2020 · 0 comments
Closed

Is it possible to hook into the expression evaluation system? #1712

egges opened this issue Sep 11, 2020 · 0 comments

Comments

@egges
Copy link

egges commented Sep 11, 2020

I'm using handlebars in a framework that generates text from templates and data. I was wondering if it is possible to provide a function that that does the actual expression evaluation. For example, I'd like my users to be able to do the following:

{{#if answer.toLowerCase().includes("hi")}}
You said hi!
{{else}}
Please try again...
{{/if}}

Or

Your answer is {{answer.toLowerCase()}}

I know that the system supports helpers, so I could use that mechanism. But it would be nice if there could be a default helper that is always called even if no helper is specified in the template.

Is something like this possible?

@handlebars-lang handlebars-lang locked and limited conversation to collaborators Dec 3, 2021
@jaylinski jaylinski converted this issue into discussion #1779 Dec 3, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants