You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The array is created in the normalizeResponse serializer of the owner.
Problem
In a template I iterate the objects of the fragment, I manipulate the fragments using: removeFragment and addFragment to add and remove (which seems to be simple wrappers for addObjects and removeObjects).
I am even calling destroy in the removed objects using .destroy() after removing it from the fragment. But, even when doing that, the fragment array gets mess up after saving the parent model, even though the response is correct when it gets to the parent serializer and seems to be correct until the point when Ember data push it into the store.
Work around that seems to work
If I sort the array by a unique object key when adding new objects and when I get it them serializer, everything seems to work ok. It seems like somehow, the array ordering is important to keep consistency when manipulated fragments inside the fragment array.
Questions
Is the ordering of a fragmentArray ordering to keep consistency?
How do I remove fragments completely from the store?
Best regards,
Daniel.
The text was updated successfully, but these errors were encountered:
Hi,
Context
I don't have much experience using fragments.
fragmentArray
and I am manipulating the objects, adding and removing them.Note: As always, willing to upgrade
normalizeResponse
serializer of the owner.Problem
In a template I iterate the objects of the fragment, I manipulate the fragments using:
removeFragment
andaddFragment
to add and remove (which seems to be simple wrappers foraddObjects
andremoveObjects
).I am even calling destroy in the removed objects using
.destroy()
after removing it from the fragment. But, even when doing that, the fragment array gets mess up after saving the parent model, even though the response is correct when it gets to the parent serializer and seems to be correct until the point when Ember data push it into the store.Work around that seems to work
If I sort the array by a unique object key when adding new objects and when I get it them serializer, everything seems to work ok. It seems like somehow, the array ordering is important to keep consistency when manipulated fragments inside the fragment array.
Questions
fragmentArray
ordering to keep consistency?Best regards,
Daniel.
The text was updated successfully, but these errors were encountered: