user: {firstName: "loki", lastName: "ch"}
I am storing this user in session storage.
$window.sessionStorage.user = user;
when i retrieved it back using
$window.sessionStorage.user
, i got:
[object Object]
I want in JSON. Any suggestions?
user
contains. Looks like it's been already converted to a JSON string. – Inaptitudeuser: JSON.parse(user)
would fix it. Go back to whereuser
gets defined and fix it there though. Show all relevant code – Pinniped