I have a TypeScript singleton class that is responsible for storing the login credentials of a user. When I set these credentials on the login page and navigate to the next page using Angular Router.navigate (without passing any parameters), everything works perfectly fine. However, if I refresh the page, the singleton becomes undefined. How can I rectify this issue?
Here is the error message that appears after refreshing:
- core.js:5980 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'socialSecurityNumber' of undefined TypeError: Cannot read property 'socialSecurityNumber' of undefined
Thank you.