I'm doing an Angular with express backend aplication. The backend gives me a response like this
console.log(res) -->
{
"ok": true,
"msg": "Login ok",
"auth": "xxxxxxxxxxxx"
}
Now that i have my response i'm trying to save it in a localStorage
localStorage.setItem('auth', res['auth']); //also tried res.get('auth');
However setItem receives string as first element, and string as second element and i keep getting the following error:
Element implicitly has an 'any' type because expression of type ""auth"" cannot be used to index type "Object".