I would like to know if it is possible to concat a variable with another string when loading a partial using Handlebars.
{{partial logos this ns=../ns nsr=../nsr id=id+"something"}}
I'd like to concat id+"something"
and storing it into id
, which would be sent to the template.
I'm using a custom helper to load partials (partial
) which merge this
with the options.hash
provided by handlebars.
You could do a slightly more reusable solution like so:
Then call it like so:
or
The reason for the looping backwards in the helper is because handlebars currently lists it's hash parameters from last to first from the order you declare them.