Search code examples
ember.jshandlebars.js

Evaluate two conditions in handlebar using ember


I was wondering if its possible to do something like this:

{{#if ClientController.Client.number && PhoneController.hasLinesToInstall}}
...
{{/if}}}

Thanks,

Juanitos


Solution

  • I don't think it's possible to chain conditions like that in handlebars like that - I can't find anything about it in the documentation.

    You could nest them though, like this:

    {{#if ClientController.Client.number}}
        {{#if PhoneController.hasLinesToInstall}}
            ...
        {{/if}}
    {{/if}}
    

    That would achieve the same outcome.