Question

The homepage on git for handlebars.js (https://github.com/wycats/handlebars.js) talks about a function called __get__ under the Block Helpers section that can be used to retrieve path variables within the current context. But it is not available within any helpers context/this. Was it removed? Is there another way to retrieve path data from inside a helper? In particular, a way to go up the ladder and retrieve parent data via the ../ path?

There is a 6 month old open issue with no discussion about it here: https://github.com/donpark/hbs/issues/18

edit: This issue is not posted on handlebars project, but an extension which recognizes the same problem.

Was it helpful?

Solution

Take a look at the issue I filed here: https://github.com/wycats/handlebars.js/issues/234

__get__ is no longer available, however if you pass 'this' in to the block explicitly you can access the parent's properties

OTHER TIPS

__get__ issue is in hbs project, not Handlebars.

New maintainer of hbs project just started looking at this issue so stay tuned. Thx.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top