Since Ember 1.13 bind-attr is deprecated. I wonder what is the best way to come around this deprecation. I found two solution which don’t seem perfect to me:
Version 1:
// in controller
...
showCss: function() {
return (this.get('finished')) ? 'show' : 'hide';
}.property('finished')
// in template
<div class="{{showCss}}">...</div>
Version 2:
// in template
<div class="{{#if finished}} show {{else}} hide {{/if}}">...</div>
How did you solve the bind-attr deprecation? Is there a nicer way than version 1 & 2?
@engwan: I didn’t know about this helper. Thanks for the hint. Nevertheless it doesn’t make my templates more readable So if I have two conditional css classes it becomes quite messy: