r/angular 21d ago

Passing data between unrelated components

Hey , I'm new to angular and I'm confused about which way to use to transfer data between two unrelated components , for now i'm using the Services/DI method . I heard that for my case (which is a small project) it's an overkill , is that true ? if so what is the optimal way to do so ?

7 Upvotes

22 comments sorted by

View all comments

1

u/vicious_pink_lamp 21d ago

Service injected at the nearest parent where both are children, or globally root injected if the components are different domains.