I'm just starting to learn angular and I'm attempting to convert my response from an interface type into a string so that I can store it in session storage. However, when I try to save them, they are being stored as [object] in the session storage
Here is my code:
const loginResponse = await this.serverLoginSvc.login(this.serverData);
console.log(JSON.stringify(loginResponse.data));
sessionStorage.setItem('source_auth_data', JSON.stringify(loginResponse.data));
where loginResponse
is of type
ApiResponseModel<AuthResponseModel>
interface
Please help me figure out what mistake I am making here