Is it possible to perform boolean logic within a handlebars conditional?
Right now I spoof this behavior with a controller function, so I end up with the controller
App.ApplicationController = Ember.Controller.extend({
bool1: true,
bool2: true,
both: function(){ return this.bool1 && this.bool2; }.property('content.both'),
});
Which allows me to use a handlebars template of
<script type="text/x-handlebars">
{{#if both}}
<p> both were true </p>
{{/if}}
</script>
and that works fine, but raises some problems. First off, it obscures what's happening (particularly if good function names aren't used). Secondly, it seems to infringes a bit on the MVC separation.
Is it possible to do something along the lines of
<script type="text/x-handlebars">
{{#if bool1 && bool2}} <!-- this will not actually work -->
<p> both were true </p>
{{/if}}
</script>
and have it work?