Answer the question
In order to leave comments, you need to log in
How to render the changed information in Angular when changing data in localstorage?
Hello. I am writing a SPA application, how can I organize a page update when information changes in localStorage.
In html there is a form and a button, when the button is clicked, a string is sent from the form to the component function, how can I subscribe to this function so that when it changes, only that part of the page that is new is rendered.
How can I do that?
Thanks for answers !
Answer the question
In order to leave comments, you need to log in
It is enough just to add comments to an array and display this array in the template, then to display new comments, you will need to add them to this array
I would write a facade service through which the entry to localstorage will go, just using RxJs I subscribed to the entry event in localstorage, passing the key, and already in the subscriber in the controller, check the necessary keys and, if necessary, set new values to the fields.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question