Replies: 1 comment
-
I'm afraid the only way to achieve this is by using a helper like in this example. Related: #1435 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Before filing issues, please check the following points first:
Link to shared example: shared example
I've just started to familiarize myself with the package, however, this is the most stunning question I cannot find an appropriate solution to.
Is there a way to be able to tell handlebars to get default property from an object by a default path if it (path) is not specified in a template?
Example:
I wanna achieve the following result.
Template:
Data:
Result:
What's going on here?
In case a path is not specified,
Handlebars
will take a "default path" from an object if it is an object, otherwise puts there an empty string.Is there a way to accomplish that using helpers or some other custom stuff?
Also, I wanna avoid additional keywords in template HTML as much as possible.
Beta Was this translation helpful? Give feedback.
All reactions