-
-
Notifications
You must be signed in to change notification settings - Fork 384
Open
Description
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, usingthis.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"?
Metadata
Metadata
Assignees
Labels
No labels