As mentioned in @andorov's answer, the OP's ideal code (<div style="width:{{model.width}}"> now pretty much just works as of Ember 1.10
I am new to Ember.js, and I am finding it difficult to dynamically change CSS. Here is an example to explain what I mean:
var App = Em.Application.create(); App.MyObj=Em.Object.extend({ objWidth:10 }); App.objController = Ember.ArrayController.create({ content: [], createObj: function(){ var obj = App.MyObj.create(); this.pushObject(obj); } });The code below doesn't work, but it explains my goal. Using a Handlebars template, I want to accomplish this:
{{#each obj in App.objController}} <div style="width:{{obj.objWidth}}"></div> {{/each}}In other words, I just want to have the width of the
<div>update when theobjWidthproperty is changed.