vendredi 18 novembre 2016

Computed property that should fire and make an API call doesn't fire at all (Ember 2.8)

I have two computed properties that should fire after month property changes. However only one of them fires and the other one doesn't.

classesForMonth fires once on init (when month is set for the first time) and doesn't fire after that.

I think it may be caused by classesForMonth.content syntax I have to use in template to render the Object received from the Promise after querying DS.

Please help me to get on a right track.

  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')




Aucun commentaire:

Enregistrer un commentaire