问题
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?
回答1:
You can use localStorage of HTML5
http://www.w3schools.com/html/html5_webstorage.asp
回答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
来源:https://stackoverflow.com/questions/26015452/how-to-persist-user-data-after-refreshing-the-page