Ampersand and Carriage Handle Templates

We found some old Handlebars patterns that work fine, but include some odd use of Handlebars.

Two strange are

{{^is_question}}{{/is_question}} 

and

 {{& answer}} 

None of these are listed in the Handlerbars docs and no helpers are defined.

Does anyone know what they are doing?

The ^ is_question function seems to be used interchangeably with {{#if is_question}}. Maybe these are some obsolete abbreviations?

A template compiles in the same way as we compile other templates:

 template = Handlebars.compile(ItemTemplate) 

Our steering wheel version:

 Handlebars.VERSION = "1.0.0-rc.3"; 
+7
javascript
source share
1 answer

I used ^ relatively recently, but I had to search for & :

 {{^ question}} X {{/question}} => inverse selection, ie if (! question ) X; {{& answer}} => unescaped, typically: {{{answer}}} 
+7
source share

All Articles