Skip to content
Advertisement

angular can not get user data form sessionstorage

sorry about my english. I use sessionstorage for keeping data. In sessionstorage have data enter image description here

but in html, not showing data form sessionstorage. when I get only {{currentUser}} in html show like this enter image description here mycode services

JavaScript

html

JavaScript

and component

JavaScript

how i can do to use please help me

this image for {{ currentUser|json}} {{ currentUser|json}}

Advertisement

Answer

In TokenStorageService change getUser() method.

JavaScript

In HTML you are printing {{ currentUser }} Which will be an object. You need to specify the property of object.

Note: If you want to see the object in html use json pipe. ({{ currentUser | json }})

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement