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
{{ message }}
Repository navigation
[Question] Do not replace if {{identifier}} data is not provided. #373
This unit test shows how to customize the output when a field binding can't be resolved:
handlebars.Configuration.UnresolvedBindingFormatter="('{0}' is undefined)";
{0} is the token that represents the name of the binding, but doesn't include any of the surrounding handlebars {{ }} syntax so you'd need to add that into your string formatter.
Alternatively you can use helperMissing feature (see this unit test for reference). This would handle both fields and helpers (in case you want to do any kind of post processing that may involve helpers).
I am having the same problem. Handlebars is stripping out all the items in the template that do not have corresponding properties in the data object. I have tried to implement the "helperMissing" solution. Unfortunately, the "arguments" parameter is always empty and it doesn't work.
Activity
rexm commentedon Oct 15, 2020
This unit test shows how to customize the output when a field binding can't be resolved:
{0}is the token that represents the name of the binding, but doesn't include any of the surrounding handlebars{{ }}syntax so you'd need to add that into your string formatter.oformaniuk commentedon Oct 15, 2020
Alternatively you can use
helperMissingfeature (see this unit test for reference). This would handle both fields and helpers (in case you want to do any kind of post processing that may involve helpers).marocano1 commentedon Mar 5, 2025
I am having the same problem. Handlebars is stripping out all the items in the template that do not have corresponding properties in the data object. I have tried to implement the "helperMissing" solution. Unfortunately, the "arguments" parameter is always empty and it doesn't work.