jeudi 6 octobre 2016

Why would an observer not fire on a CONSUMED computed property?

I've got an observer referencing a computed property that never gets hit. I'm aware of the issues with observing computed properties that don't get used, but I don't think that that case applies here given that it's used in a template. Here's a basic example of what I'm doing.. I feel like I've done this a million times without issue.

someStringProp:Ember.computed('someEmberService.someProperty', function(){
  //do stuff, build string
  debugger; //hit
  return retStr;
}),

updateStuffUsingSomeStringProp:Ember.observer('someStringProp',function(){
  debugger;  //not hit
  //do stuff
}),

template:



In addition I have another observer in the same file that references a (non-computed) service property that also does not fire when that property is updated. E.g.:

someObserver:Ember.observer('someEmberService.someProperty', function(){
   debugger; //not hit
  //do stuff
}),




Aucun commentaire:

Enregistrer un commentaire