title: Access variable from one component into another
body: <p>Im trying to do some angular project, but im not into web development. Its simple shop. 
  <br>I wanted to get some informations from sqlite by Play Framework. It is working.
  <br><br>After I receive it in angular and display.
  Its working too. Service:</p>
  
  <pre><code>@Injectable()
  export class ProductService {
  
  constructor(private http: Http) { }
  
  getProducts() {
    const headers: Headers = new Headers();
    headers.append('Accept', 'application/json');
    headers.append('Content-Type', 'application/json');
  
    const options = new RequestOptions({headers: headers});
  
    return this.http.get('http://localhost:9900/', options)
    .map(response =&gt; &lt;Product[]&gt;response.json());
   } 
  }
  </code></pre>
  
  <p>And place when i take all products:</p>
  
  <pre><code>export class ProductComponent implements OnInit {
  
  public products: Product[];
  actualProduct: Product;
  productForm: FormGroup;
  public quantity: number;
  private activeFilter: string = "reset";
  public allFilters: Array&lt;string&gt;;
  
  
  constructor(private productService: ProductService,private router:Router) {
    this.allFilters =  ['ocean', 'river', 'aquarium', 'reset'];
  }
  
  ngOnInit() {
    this.productService.getProducts().subscribe(data =&gt; this.products = data);
  }
  
  public getActualProduct() {
    return this.actualProduct;
  }
  
  clickedProduct(product) {
    this.actualProduct = product;
    let link = ['/detail', product.prodId];
    this.router.navigate(link);
  }
  
  public setFilter(filter: string) {
   this.activeFilter = filter;
   }
  }
  </code></pre>
  
  <p>So my question: how can I access to array products in other components? Cause now, when i click on button with function clickedProduct its working perfect. It display in console object product. But when I try to use product to display product details in other component I fail:</p>
  
  <pre><code> export class ProductDetailComponent implements OnInit {
  
   selectedProduct: Product;
   products: Product[];
   quantity: number;
  
   constructor(
   private productService:ProductService,
   private productComponent: ProductComponent,
   private route:ActivatedRoute,
   private location:Location,
    // private cartStore: CartStore
   ) {  }
  
  ngOnInit() {
      this.selectedProduct = this.productComponent.getActualProduct();
  }
  
  addToCart(product) {
    console.log(this.selectedProduct)
    console.log(product)
    //this.cartStore.addToCart(product, this.quantity || 1)
  }
  
  goBack() {
      this.location.back()
   }
  }
  </code></pre>
  
  <p>How can I get actualProduct variable in ProductDetailComponent, or how can I get array of all products? 
  I tried use "@Input() actualProduct: Product" in productComponent, but It actually doesnt work.
  Thanks for help.</p>