Skip to content

lambda helpers only receive options if used with arguments #599

@laurie71

Description

@laurie71

If my template contains {{#foo something}}...{{/foo}} and the value of foo in the current context is a function, it will be called with arguments ["something", options]. However, if the helper is used without arguments ({{#foo}}...{{/foo}}), the function will be called without arguments. It should be called with a single options argument.

Use case: I'm implementing a multi-conditional helper (swtich-when-otherwise) where switch and when will require a single argument, and otherwise will be used without an argument. In the otherwise helper, I need to access options.data to determine if any of the when clauses have matched, and options.fn to render the otherwise block if not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions