title: Angular 2 Service not returning value assigned
body: <p>I am using service for sending data from a component to other.</p>
  
  <p>My service follows</p>
  
  <pre><code>import {
      Injectable
  } from '@angular/core';
  
  @Injectable()
  export class HomeService {
      values = new Array();
  
      setValues(values): void {
          this.values = values;
      }
  
      getValues(): any[] {
          return this.values;
      }
  }
  </code></pre>
  
  <p>Setting value in a component</p>
  
  <pre><code>setType(type) {
    this.values["plan"] = "HMO";
    this.homeService.setValues(this.values);
  }
  </code></pre>
  
  <p>Getting value in other</p>
  
  <pre><code>ngOnInit() {
    this.homeValues = this.homeService.getValues();   
    console.log(this.homeValues);
  } 
  </code></pre>
  
  <p>Above console printing [], how to get assigned values from service?</p>