Skip to content

Support logical operators in HTML Template code #355

@jankapunkt

Description

@jankapunkt

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions