mardi 6 octobre 2015

ember data array UI not updating on pushObject

I have a list of product-tag that I fetch for my model.

Route:

model: function() {
  return {
    product_tags: this.store.find('product-tag', {merchant: merchId})
  }
}

I have a component that adds tags to the model, however when after I create the record and push it into the model (as suggested on other posts) my UI still isn't updating.

addTag: function(name) {
  tag = this.store.createRecord('product-tag', {
    name: name
  });
  this.model.product_tags.toArray().addObject(tag);  

  tag.save();
}

What am I doing wrong? Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire