jeudi 30 novembre 2017

Modifying model's observed properties in action Ember

I have a search results page with the retrieved search results stored in the model as results. on the same page, I have a button to check all the results for extraction.

I have a property named checked and initially, it is set to falsein the button action I want to change this property on each result to true.

this is my action

checkAll(){
      this.controller.get("model.results").map(doc=>{
        doc.checked = true;
      })
    }

but I keep getting this error:

Assertion Failed: You must use Ember.set() to set the checked property (of [object Object]) to true.

I don't how to use Ember.set() only on that property. and I don't know if this is the right way to go about this as I'm new to ember.

any help would be much appreciated. Thank you.




Aucun commentaire:

Enregistrer un commentaire