I'm trying to use a computed property in a model to render data in the template. Here's a snippet of my model:
App.ApplicationRoute = Ember.Route.extend({
model: function() {
...
divStyle: function() {
return "height:" + this.get('height') + "px; color:"+ this.get('color') +";";
}.property('height', 'color')
}
}
and here's a snippet of my template:
{{#each}} <div {{bindAttr style="divStyle"}}</div> {{/each}}
But I'm getting the following error: "Assertion failed: Attributes must be numbers, strings or booleans, not function". I was following this post: Ember.js binding a css style in a template and somehow its not working. Any ideas?
