1
这看起来好像很明显。我不知道我要去哪里错。Ember Array调用getBy上的返回返回undefined
在控制器,对于计算性能:
totalMonthlyEsales: (->
@findBy('key', 'value1')
).property('@each.answer')
我可以要求我的模板罚款此属性。
<div>{{totalMonthlyEsales.answer}}</div>
返回“23424”
但是,如果我尝试
totalMonthlyEsales: (->
@findBy('key', 'value1').get('answer')
).property('@each.answer')
我得到的错误“遗漏的类型错误:无法调用的未定义‘得到’” 最后,我想要做的事像
totalMonthlyEsales: (->
parseInt @findBy('key', 'value1').get('answer')
).property('@each.answer')
plccDcSalesCash: (->
parseInt @findBy('key', 'value2').get('answer')
).property('@each.answer')
otherTenderTypes: (->
@get('plccDcSalesCash') - @get('totalMonthlyEsales')
).property('totalMonthlyEsales', 'plccDcSalesCash')
这属于Coffeescript?...这就像在C下发布C++,因为它只是C. – elclanrs