-
-
Notifications
You must be signed in to change notification settings - Fork 388
Closed
Labels
Milestone
Description
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.
Reactions are currently unavailable