How to pass data between two components in Angular 2

You can transfer data using service. Make a service that holds the data while you switch components. Below is an example. import { Injectable } from ‘@angular/core’; @Injectable() export class TransfereService { constructor( private router:Router, private companyServiceService:CompanyServiceService ) { } private data; setData(data){ this.data = data; } getData(){ let temp = this.data; this.clearData(); return temp; … Read more