lundi 30 juillet 2018

this is undefined in controller (ember, 3.x)

Run into a problem with ember (v.3.x), and cannot figure out why. I did not find anything (that worked in my case) in the docs nor here.

So, here's the problem: this returns undefined in my controller inside the computed property (undefined.get('filter')). The rest of my function works, so I did not put it in here.

// in dic.js (controller):
export default Controller.extend({
  filter: '',
  filteredTerms: computed('filter', () => {
     const x = this.get('filter');
     // ...
}),

The corresponding input field:

// in dic.hbs


In my route I just return the model, which should be filtered by that function.




Aucun commentaire:

Enregistrer un commentaire