I need help with the following:
I have a variable in a service and I need to give that variable a value in one component and use that variable in another component with the previous value I just assigned that variable to. I included the service in the providers array of the app.module.ts file but when instantiating the service in any component, the value of that variable is reset to the default value defined in the service file (undefined/value assigned to). How do I keep a certain value in a service variable when routing without it changing?
myService: MyService = new MyService();?