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 logical operators in HTML Template code #355

Open
jankapunkt opened this issue Oct 6, 2021 · 1 comment
Open

Support logical operators in HTML Template code #355

jankapunkt opened this issue Oct 6, 2021 · 1 comment
Milestone

Comments

@jankapunkt
Copy link
Collaborator

jankapunkt commented Oct 6, 2021

I often have much redundancy when just trying to pass conditional paramters. For example:

{{#if condition}}
  {{> otherTemplate param=1}}
{{else}}
  {{> otherTemplate param=2}}
{{/if}}

alternative would be now to create another helper (because condition is shared, which I can't simply return the value from this helpert) but that increases the js code a lot for many simple conditions.

Way better would be

{{> otherTemplate param=(condition ? 1 : 2)}}

That would also make many custom Template helpers packages obsolete and thus again reduce bundle size.

Any ideas or ciritcs on that?

@filipenevola
Copy link
Collaborator

LGTM

@StorytellerCZ StorytellerCZ added this to the Blaze 3.0 milestone Jan 1, 2022
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

3 participants