I am trying to pass data between pages in the checkout process of an app but it\'s not working the way it should. I have done some reading and most people recommend using a
You can use Session/LocalStorage. Or a browser db like pounchdb. Seesion storage: store session data; LocalStorage: store data not just session scope pounchdb : offline db
There are several options to do this,
Note: only the first two are persistent.
In your case I think that using local storage or the cookiestore will be you best options. You are trying to use a service, which would be appropriate if you did not want it to be persistent (leaving the page or a page refresh). Services are singletons that being managed by angular, when injected you will get a reference to the same object in each injection. However, when returning to the page this singleton will need to be re initialized, thus losing all previous data. The only way to make make a service persistent would be to load the data from a database, a local file, or noSQL from elsewhere. However, I do not think this is really what you are after.
If you are interested in pursuing the local storage implementation then look into these modules angular-local-storage, ngStorage or this answer
If you want to use the cookiestore look into this answer