I am looking for solution to pass data to another component and similarly access methods of another component in other (both are parallel components).
For example i have two components home.ts
and map.ts
.
I get some data into map.ts
and need to pass that in home.ts
and vice versa.
Make a service that holds the data while you switch components. Below is an example.
Now Consider 2 components Sender and Reciever.
Senders code: This code sets the data to the service and navigates to the receiver.
Reciever's Code: This code fetches the data from service and clears the data as well.