I have a template taskList
that receives a list of tasks and an options hash as arguments like this:
{{> taskList tasks=taskHelper options=listOptions}}
In this case, the taskHelper
returns all existing tasks. Is it possible to pass arguments to the taskHelper
in this scenario? For example, if I want to show only done tasks in the template, I would like to do something like this:
{{> taskList tasks=taskHelper 'done' options=listOptions}}
That won't work because the template compiler doesn't treat 'done'
as argument for the helper but as a non-keyword argument for the template, resulting in this error message:
Can't have a non-keyword argument after a keyword argument
meteor < 1.1.1
You can make it work without any changes to your helpers by doing this:
meteor >= 1.1.1
Nested helper expressions should solve this problem: