Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support handlebars block shortcuts #12

Open
ahumphreys87 opened this issue Mar 28, 2016 · 0 comments
Open

Support handlebars block shortcuts #12

ahumphreys87 opened this issue Mar 28, 2016 · 0 comments

Comments

@ahumphreys87
Copy link
Owner

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');
  });
@ahumphreys87 ahumphreys87 changed the title Support handlebars booleans Support handlebars block shortcuts Mar 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant