I am trying to set up a global service which can be accessed through out all the components, precisely I wish to store user related information using this service like roles, name etc. and use it later in all components
I have tried with singleton, but It got clear after browser refresh.
How to achieve this any guidance will be appreciated.
The singleton service is like this:
export class Principal{
private isAuthenticated: boolean = false;
private roles: Array<String>;
private fullName: String;
constructor(){} ;
// getter and setter
}