mercredi 26 juillet 2017

How is selectedSection.savedItems computed property modified twice?

I am looping through saved items in my component template and I am getting the following error:

"Assertion Failed: You modified selectedSection.savedItems twice on <wc-app@model:plan-section::ember615:goal> in a single render. This was unreliable and slow in Ember 1.x and is no longer supported.

This is the code in the component template:



This is the savedItem computed property on the plan section model:

savedItems: Ember.computed('orderedItems.@each.isNew', function() {
    let itemsSaved = this.get('orderedItems').filter( (i) => !i.get('isNew')) || [];
    return itemsSaved;
  }),

When there is 1 item or more this problem does not happen but when there are 0 items it causes this error.

How is this computed property modified twice?




Aucun commentaire:

Enregistrer un commentaire