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
I've been trying to convert my Handlebars models to ExpandoObjects, as recommended in various issues here. However, I've found that that a HandlebarsUndefinedBinding exception is thrown for null values.
For example, I'd like to make use of templates and models like the following:
{{#if PerhapsNull}}
It's not null
{{else}}
It's null
{{/if}}
dynamic data = new ExpandoObject();
data.PerhapsNull = null;
This doesn't work, however, due to the aforementioned exception. I'm aware that I could suppress this exception by setting ThrowOnUnresolvedBindingExpression = false, but I'd rather not do this. (And it seems to me that, in the example I've given, the expression in question should not be considered unresolved.)
The text was updated successfully, but these errors were encountered:
oformaniuk
added a commit
to oformaniuk/Handlebars.Net
that referenced
this issue
May 30, 2020
I've been trying to convert my Handlebars models to ExpandoObjects, as recommended in various issues here. However, I've found that that a
HandlebarsUndefinedBinding
exception is thrown fornull
values.For example, I'd like to make use of templates and models like the following:
This doesn't work, however, due to the aforementioned exception. I'm aware that I could suppress this exception by setting
ThrowOnUnresolvedBindingExpression = false
, but I'd rather not do this. (And it seems to me that, in the example I've given, the expression in question should not be considered unresolved.)The text was updated successfully, but these errors were encountered: