I've been watching Chris Mathers super helpful videos about Blaze/Shark on Evented Mind. I wanted to clarify how parameters now get passed from a {{> }} template inclusion as it appears that it's changed since the video:
In the lesson Chris shows how the following would get passed into the template helper as parameters:
{{> greeting "joe" "smith" salutation="mr" }}
greeting: (firstName, lastName, options) ->
console.log firstName, lastName, options
However, I find that if I include parameters like this I get a compile error on the template, saying what it's expecting is a function to be passed as the first argument which is subsequently used for the parameters.
When I do something like that, eg:
{{> greeting myFunc "joe" value=123 }}
myFunc: (args...) -> console.log 'myFunc', args
I can see the values getting passed through to that function. myFunc emits this to the console (with Spacebars.kw containing a hash with the options in it).
["joe", Spacebars.kw]
---
I don't get how to use this. I'd like to somehow get the arguments piped into the
greeting function. However I can't see how to get access to args, and don't understand what the additional first-parameter-function is for. Also, I can't see any examples of parameter passing in the
Using Blaze wiki.
Am I missing something? Thanks everyone.