Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Communication between two sibling components in angular 2 #2663

@nrmaridu

Description

@nrmaridu

I am right now working on angular 2. I found that the communication between the two sibling components or from child to parent is difficult. Even it was not mentioned in the angular 2 documentation. Would you please provide some information about it because the way two sibling components communicate is looking complex than the way a parent component communicates with its child using the 'ViewChild' decorator. But it is not possible to make a parent child relationship between two components always as per the project requirements.

Please find the below scenario of component tree.
A
/
B C
/ \ /
D E F G
Here If I want to communicate between the components 'A' and 'B' then I can use 'ViewChild' decorator because they both are in parent child relationship.
If I want to communicate between the components 'B' and 'G' then How to do it? Because I can't impose parent child relationship between those two.

Would you pleas address the above issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions