ember.js - itemController and bindAttr not working -
i have following code in emblem.js template:
each line_items itemcontroller=lineitem .line_item.row-fluid.popover_link id="line_item_#{unbound id}" click="lineitemselected" class={selected ordered} .span8 = product.name if notsingleitem span.quantity   x #{quantity}
a model:
app.lineitem = ds.model.extend quantity: ds.attr 'number' #this duplicated reason product_price: ds.attr 'number' order: ds.belongsto 'cluey.order' product: ds.belongsto 'cluey.product' total: ember.computed -> @get('quantity') * @get('product_price') .property('quantity', 'product_price') notsingleitem: ember.computed -> @get('quantity') != 1 .property('quantity') div_id: ember.computed -> "line_item_" + @get('id') .property() ordered: ds.attr 'boolean', { defaultvalue: false } should_print: ds.attr 'boolean', { defaultvalue: true }
now, class attributes bound attributes on lineitem model has attribute "ordered" have set true test, not seem display class of ordered, when attribute set true.
Comments
Post a Comment