3
I see in some native tools on javascript
, the option to redo and undo, as if it were a Ctrl + z
and Ctrl + y
, but they are graphical tools and not forms.
I thought of something like...
- The components will be
estáticos
. - Each component will have its own dynamically generated code.
- Each action will have an initial value and a final value, this data will be stored in a
objeto
to undo together with component code. - By triggering the
Ctrl + Z
the last element is taken from theobjeto
to undo and placed in another responsible for restoring, and when moving its initial value is exchanged for the final and compiled into the component withangular
and vise versa.
I did some tests and it’s totally possible to do this, but the work will be huge, because everything is created dynamically. Is there any other way to implement this? using cache or some library? I found nothing related on the internet.
Thanks for answering, I will test it later and give the feedback, but from what I realized it is for canvas, in my case I will not use canvas
– Felipe Duarte
I hope I helped... And I believe that it serves for any object both graphic and diverse components, as shown in the example code (Person). Everything will depend on implementing library methods to suit your components.
– Zulian