Accessing Array/object Variables By Key, Within A Handlebars Mustache
I can't seem to find a way of doing this, and have tried subexpressions and various other answers posted on StackOverflow - but they all seem to assume that I know the key I'm usin
Solution 1:
I would not create a custom helper for this. Instead, I would use the existing Lookup helper partnered with the with block helper:
{{#with (lookup fields field_id) as |field|}}
{{field.complete}}
{{/with}}
Alternatively you could use the lookup helper with a subexpression:
{{lookup (lookup fields field_id) 'complete'}}
Post a Comment for "Accessing Array/object Variables By Key, Within A Handlebars Mustache"