I do not think that handlebars supports multiple elements in the {{#if}} operator (related: The logical operator in handlebars.js {{#if}} is conditional ).
You can collapse multiple values ββin your controller / view into one computed property and check this is the only value in the template. This new computed property will be updated when one of the original values ββis updated:
App.ValuesTestController = Ember.Controller.extend({ value1: false, value2: true, value1and2: function(){ return this.get('value1') && this.get('value2'); }.property('value1', 'value2') });
Your template will look like this:
<div>{{#if value1 }}value 1 true{{/if}}</div> <div>{{#if value2 }}value 2 true{{/if}}</div> <div>{{#if value1and2 }}value 1 and 2 true{{/if}}</div>
CraigTeegarden
source share