我有两个在month
属性更改后应触发的计算属性。然而,其中只有一个发生火灾,另一个没有发生。应该触发并进行API调用的计算属性根本不会触发(Ember 2.8)
classesForMonth
在初始化时触发一次(当month
第一次设置时)并且在此之后不触发。
我认为这可能是由classesForMonth.content
语法造成的,我必须在模板中使用它来呈现在查询DS之后从Promise接收到的对象。
请帮助我走上正确的轨道。
classesForMonth: function() {
console.log('hi im querying store') // doesn't fire on month change
return this.get('store').query('class', {
month: this.get('month') + 1,
});
}.property('month'),
formattedMonth: function(){
console.log('hi im formatting month') // does fire on month change
return moment.months()[this.get('month')]
}.property('month')
您使用的是什么版本的余烬? –
我正在使用Ember 2.8。 – Senthe
你在模板中使用formattedMonth吗? – GerDner