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
If you use the key "empty" in your model it won't resolve correctly when referenced from a partial template. For example:
template.hbs
template: {{empty}}
{{> partial}}
partial.hbs
partial: {{empty}}
Code:
Map<String, Object> model = new HashMap<>();
model.put("empty", false);
Template template = handlebars.compile("template");
System.out.println(template.apply(model));
Output:
template: false
partial: true
It looks like this is happening because the partial's extended context gets set to an empty map and is also treated as higher priority for resolution than the original context. When the partial tries to resolve "empty" against the extended context it produces a value of true because the JavaBeanValueResolver calls the Map.isEmpty() method.
The text was updated successfully, but these errors were encountered:
If you use the key "empty" in your model it won't resolve correctly when referenced from a partial template. For example:
template.hbs
partial.hbs
Code:
Output:
It looks like this is happening because the partial's extended context gets set to an empty map and is also treated as higher priority for resolution than the original context. When the partial tries to resolve "empty" against the extended context it produces a value of true because the JavaBeanValueResolver calls the Map.isEmpty() method.
The text was updated successfully, but these errors were encountered: