In my application, I have a single object stored in $rootScope. I need to find a way to save its state when the user refreshes the app either by pressing F5 or manually. While I've come across examples using $cookies in Angular, they only allow for saving primitive types. The best I could do is save the object as JSON and then restore it from that data later on.
Can anyone provide an example or suggest a library that makes implementing this feature easier, without needing too much additional code?