title: Angular 2: sharing data across different routes
body: <p>I have searched for similar questions in SO and I have not found any that addresses my specific case. There are many techniques to share data between angular components, and I have read this article about component communication: <a href="https://angular.io/docs/ts/latest/cookbook/component-communication.html" rel="noreferrer">https://angular.io/docs/ts/latest/cookbook/component-communication.html</a></p>
  
  <p>However none of the techniques described there work for me, because my components are on different routes. The article describes mostly parent-child component communication, and some cases may work for sibling components as long as they are both loaded at the same time.</p>
  
  <p>My case is very similar to the Angular 2 Heroes tutorial: I have a route that displays a table with a list of customers (instead of heroes). When the user clicks on a specific customer, I trigger a route change to display a form with the data for the selected customer (instead of hero).</p>
  
  <p>The heroes tutorial performs a service invocation to retrieve the selected hero data, but I want to avoid a useless additional AJAX call, given that those data are already in memory. I just want to pass the selected customer data to the customer form component so it is immediately displayed.</p>
  
  <p>I am thinking of a "global session" service where I could store and retrieve any object I want, but I am not sure this is a good idea. Are there other more adequate approaches?</p>