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

Support for If statements with logic expressions in templates by default without helpers #844

Closed
ghost opened this issue Aug 8, 2014 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 8, 2014

It would be really neat if Handlebars.js would support If statements with logic expressions in templates by default, without helpers. Then I could do amazing things, like this:

{{#if unicorns == ponies }}
That's amazing, unicorns are actually undercover ponies
{{/if}}

Also see this blog post on the issue.

@kpdecker
Copy link
Collaborator

This greatly complicates that language and is something that we do not wish to implement as all functionality can be implemented via subexpressions and is far more extensible. #616 has some discussion on this. Helpers can be implemented to do things such as {{#if (equal a b)}}.

@ghost
Copy link

ghost commented Apr 22, 2015

I, too, wish for basic comparisons in Handlebars. I understand the logicless philosophy. I also believe basic comparison support would be more intuitable and allow users to work more efficiently. If users in mass are moving basic comparison logic to a helper, this philosophy isn't doing them a favor or dissuading a perceived suboptimal behavior—it's just creating more work.

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