DEV Community

[Comment from a deleted post]
Collapse
 
alexf profile image
Alex F.

You need Two-way-binding between components:
stackoverflow.com/a/36247095
Changes Template
Changes Component

Although I would probably create a service and put the array and all the methods (for create, delete, update etc) there and in the component just use that service.

Collapse
 
mateuszto profile image
Mateusz Tomczyk

Did you know now how to solve problem with id when i delete all notes and try to add a new one?

Collapse
 
alexf profile image
Alex F. • Edited

This works:
new set

Although I'm no expert XD. Seems logical you can't reverse an empty array.

 
mateuszto profile image
Mateusz Tomczyk

Thank you so much!

Collapse
 
mateuszto profile image
Mateusz Tomczyk

Thanks a lot!