You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There was some discussion on inline partial definitions and mustache/spec#63 but it looks like it went off the rails a bit.
I'm addicted to 'capture' in the erb/haml world. It seems to me that combined with subexpressions, you could use inline partial definition to pass the outputs of multiple blocks to a view or helper. Using one of the proposed partial definitions from @spudly, you'd be able to write code like this:
{{>> bold-name}}
<strong>{{name}}</strong>
{{/>>}}
{{#tooltip title:(bold-name)}}
My name is bold.
{{/tooltip}}
Maybe partials could even accept arguments. Sorry if I've got to wrong forum for this and if there is some better existing solution that I haven't stumbled across. I think that the general push on the mustache site discussion was to define such helpers outside the template. I didn't quite follow all the reasons given to oppose this idea, but given how convenient I find 'capture' in rails, I'd love for handlebars to offer the same convenience.
Thanks for your consideration. If there's interest in this, I might investigate a pull request for this.
The text was updated successfully, but these errors were encountered:
There was some discussion on inline partial definitions and mustache/spec#63 but it looks like it went off the rails a bit.
I'm addicted to 'capture' in the erb/haml world. It seems to me that combined with subexpressions, you could use inline partial definition to pass the outputs of multiple blocks to a view or helper. Using one of the proposed partial definitions from @spudly, you'd be able to write code like this:
Maybe partials could even accept arguments. Sorry if I've got to wrong forum for this and if there is some better existing solution that I haven't stumbled across. I think that the general push on the mustache site discussion was to define such helpers outside the template. I didn't quite follow all the reasons given to oppose this idea, but given how convenient I find 'capture' in rails, I'd love for handlebars to offer the same convenience.
Thanks for your consideration. If there's interest in this, I might investigate a pull request for this.
The text was updated successfully, but these errors were encountered: