We found some old Handlebars templates which are working fine, but include some odd usage of Handlebars.
The two strange ones are
{{^is_question}}{{/is_question}}
and
{{& answer}}
Neither of those are listed in the Handlerbars docs and there are no helpers defined.
Anyone know what they do?
The ^is_question appears to be used interchangeably with {{#if is_question}}. Maybe it is some deprecated shorthand notation?
The template is piled the same way we pile other templates:
template = Handlebarspile(ItemTemplate)
Our handlebars version is:
Handlebars.VERSION = "1.0.0-rc.3";
We found some old Handlebars templates which are working fine, but include some odd usage of Handlebars.
The two strange ones are
{{^is_question}}{{/is_question}}
and
{{& answer}}
Neither of those are listed in the Handlerbars docs and there are no helpers defined.
Anyone know what they do?
The ^is_question appears to be used interchangeably with {{#if is_question}}. Maybe it is some deprecated shorthand notation?
The template is piled the same way we pile other templates:
template = Handlebars.pile(ItemTemplate)
Our handlebars version is:
Handlebars.VERSION = "1.0.0-rc.3";
Share
Improve this question
edited Nov 19, 2014 at 21:33
BishopZ
asked Nov 19, 2014 at 20:38
BishopZBishopZ
6,3888 gold badges47 silver badges60 bronze badges
2
- I don't recognize this either. Is it possible someone had a custom task to translate this notation into true handlebars? – runspired Commented Nov 19, 2014 at 20:56
- use of ^ seems to be taken from Mustache templating – jagershark Commented Mar 11, 2016 at 15:15
1 Answer
Reset to default 10I've used ^ relatively recently, but I had to look up &:
{{^ question}} X {{/question}} => inverse selection, i.e. if (! question ) X;
{{& answer}} => unescaped, typically: {{{answer}}}
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744227478a4564081.html
评论列表(0条)