I’d just like to add that there is another way to control the Ember/Handlebars {{#if}} block. Imagine you had a data type called SensorReading that has a value. That value might be null. You could define this:
SensorReading = Ember.Object.extend({
isTruthy: function() {
return !Ember.isNone(@get("value"))
}.property("value")
})
Perhaps this isn’t intended to be public, but as you can see, {{#if}} will look at the value of isTruthy
to determine if the block should show or not. So you could have:
{{#if reading}}
{{value}}
{{/if}}
…where reading
is always an object.