You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As well as using if blocks, handlebars also supports using a shortcut for booleans and arrays, this doesnt seem to be documented however.
The following test case illustrates its use:
it('boolean', function() {
var string = '{{#goodbye}}GOODBYE {{/goodbye}}cruel {{world}}!';
shouldCompileTo(string, {goodbye: true, world: 'world'}, 'GOODBYE cruel world!',
'booleans show the contents when true');
shouldCompileTo(string, {goodbye: false, world: 'world'}, 'cruel world!',
'booleans do not show the contents when false');
});
The text was updated successfully, but these errors were encountered:
ahumphreys87
changed the title
Support handlebars booleans
Support handlebars block shortcuts
Mar 28, 2016
As well as using
if
blocks, handlebars also supports using a shortcut for booleans and arrays, this doesnt seem to be documented however.The following test case illustrates its use:
The text was updated successfully, but these errors were encountered: