1
示例代码:观察整个ArrayProxy
var Day = Ember.Object.extend({
date:null,
activities:null, // is set to an Em.ArrayProxy in instantiation
historicalSection:function(){
return this.get('activities').filterProperty('inHistoricalSection', true);
}.property('activities').cacheable()
});
当 '活动' 被设置为ArrayProxy, 'historicalSection' 计算的属性,都会计算。但是,当'activities'处的ArrayProxy被更新时(即其长度发生变化),'historicalSection'属性不会更新。
任何想法,为什么?
非常感谢。 activities.length为我工作。 – Rajat