I'm using a lot of the following in my templates:

{{#if isController}}

To make that line usable, I have to serialize the data and add the isController attribute to it. Instead, I'd like to use an isController Handlebars helper.

Problem: cannot pass another helper as an argument to the #if helper.

Question: Is there a way I can pass a Handlebars helper as an argument to the #if helper?

有帮助吗?

解决方案

Since version 1.3 you can do this:

{{outer-helper (inner-helper 'abc') 'def'}}

More info here

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top