title: Angular 2 Setter and Getter
body: <p>I am attempting to create a service to parse data to different components on different routes.</p>
  
  <p>If I call the follow service on the same component I get the result I require, but if I try to get the set results from another component the service returns undefined.</p>
  
  <p>Here is my service:-</p>
  
  <pre><code>import {Injectable} from '@angular/core';
  
  @Injectable()
  export class TestService {
  
    public _test:any;
  
    set test(value:any) {
      this._test = value
    }
  
    get test():any {
      return this._test;
    }
  }
  </code></pre>
  
  <p>I set the service like:-</p>
  
  <pre><code>this.testService.test = 3;
  </code></pre>
  
  <p>and I receive the the service data in my component using the following:-</p>
  
  <pre><code>console.log(this.testService.test)
  </code></pre>
  
  <p>As mention before this works absolutely fine if I am communicating within the same component, I have the same imports, providers and constructor.</p>
  
  <p>Also just a note the components are sibling components</p>
  
  <p>Would anybody be able to help or point me in the right direction it would be very appreciated.</p>
  
  <p>If you require any extra code please let me know.</p>