I have couple of check boxes and input fields. When any of them are checked or any value entered to the input fields, I need to persist these data even after refreshing or URL location change.Can someone help me?
Asked
Active
Viewed 1,878 times
0
-
For browser refresh you need to look at browser `localStorage` supported by all modern browsers. – Chandermani Sep 24 '14 at 11:17
-
I have 5 different forms. One after another. Data to be saved only when last form is filled. In between this if use refreshes the page, I want data should not lost. – Ved Sep 24 '14 at 11:17
-
Here you can find a good answer: http://stackoverflow.com/questions/12895754/how-to-save-the-state-of-a-javascript-variable-that-is-used-in-multiple-html-pag – Entomo Sep 24 '14 at 11:39
2 Answers
2
Use cookies, they are the most reliable way to save data across browsers, also you can later access it server side. If you don't need expiration or advanced functionality you can use the $cookieStore, otherwise you should use something else.
Although, I would not recommend using this, unless is only for the user experience. If you are relying in this mechanism to give save-like functionality I would strongly recommend you search another approach

Nickydonna
- 802
- 1
- 5
- 18