Reputation: 301
I have been trying to pass the spacebar as another spacebar argument like this :
{{helperfunction {{argument}} }}
here the {{argument}} is also coming from another helper function.
Is there any way to achieve this?
Upvotes: 1
Views: 301
Reputation: 482
You do not need to use the additional {{}}
.
lets say that argument
is a string and helper function is expecting a string then {{helperFn argument}}
is like helperFn(argument)
. So the single {{ ... }}
is sufficient. {{}}
using the bracket is like opening a javascript context (kind of) so if arguments
is already a defined var that is in scope, there is no need to add additional {{}}
.
if you do want to compose blaze helper functions, you can do that by using parens like so {{helperFn1 (helperFn2 argument)}}
.
this would be like helperFn1( helperFn2(argument) )
also, if argument
is a function, I believe that blaze will call the function and return the result automatically. => {{helperFn argument}}
is like helperFn(argument())
.
hope that helps a bit.
Upvotes: 2