Here is my code.
User can click on the link to pop up a dialogue box where the attributes of the person object can be modified.
I faced 2 problems
When the user modifies some attribute and then click on the "close" button in the dialogue box, how can I restore the original status of the person object?
For example: A user clicks on the link "Peter", and then remove the "r" from the name, click on the close button to close the dialogue box, however, the name "Peter" in the parent windows is changed to "Pete" accordingly. How to prevent this phenomenon occurs again?
When the user modifies some attribute and then click on the "save" button in the dialogue box,
how can I update the modified model data to the material table in the main component?In line 24 of personEditor.component.ts, I use
result=true;
to simulate the update result.
If the result=true, I expect the modified model data should be updated to the main component, else the original model data should be updated to the main component. However, both cases are not working as expected.