Closed tommueller closed 6 years ago
Hi @tommueller
I am preparing a new release which will have AddChildData
and RemoveChildData
actions, you might play with them in the current develop branch, will be released with version 2.2.0.
Closing this in favour of #20
Hi,
I have a question on best practice of using ngrx-normalizr. If I want to add a child to a deeper nested element, how would you do it?
My element looks like this:
{ "id": "page1", "sections": [{ "id": "section1", "fields": [{ "id": "field1" }] }] }
Now I want to add a new field and of course I have to tell the storage, that I want the new field, within section1, within page1. During updating this is not a problem, since all ids are unique. But when adding I have to tell the store at least the section.
When adding a field using
AddAction<Field>
it gets added correctly but not linked to any section. How do you solve this in the best way? Adding the field and then linking it to a section? Or basically by taking the section, adding the field to the section and then "updating" the whole section.Thanks! Tom