title: Make a service variable global in Angular 2
body: <p>How can I make a variable in a service in Angular 2 as a global variable so that two different components can access and modify it?</p>
  
  <pre><code>public myMap : Map&lt;string, string&gt; = new Map&lt;string, string&gt;();
  </code></pre>
  
  <p>This is the map in the service and I'm populating it initially using a component. Now after some time in the application, I need to access the same populated map using a different component. How can I do this?</p>
  
  <p>When I access the map using another component, it displays as undefined.</p>