Let's say I have a class like this:
public class CodegenMap extends CodegenType {
private CodegenType values;
// constructors...
// setters & getters...
@Override
public boolean isMap() {
return true;
}
}
And we have this recursive template (property.hbs):
{{#if isArray}}{{{typeName}}}<{{#items}}{{>property}}{{/items}}>{{/if}}
{{~#if isMap}}{{{typeName}}}<{{#values}}{{>property}}{{/values}}>{{/if}}
{{~#if isModel}}{{{typeName}}}{{/if}}
{{~#if isPrimitive}}{{{typeName}}}{{/if}}
Using the log helpers I got the followings:
{{log values}} -> [2, false]
{{log this.values}} -> ...model.CodegenMap@aeab7ff3
So as we can see, using this.values works fine.
I dug into the code a bit to figure out what Handlebars was doing with the values value, but I couldn't.
Could you please explain this behavior of Handlebars to me?
Also, are there any other "keywords" that should be avoided or can only be used with "this"?
Let's say I have a class like this:
And we have this recursive template (property.hbs):
Using the
loghelpers I got the followings:{{log values}}->[2, false]{{log this.values}}->...model.CodegenMap@aeab7ff3So as we can see, using
this.valuesworks fine.I dug into the code a bit to figure out what Handlebars was doing with the
valuesvalue, but I couldn't.Could you please explain this behavior of Handlebars to me?
Also, are there any other "keywords" that should be avoided or can only be used with "this"?