Angular: Interaction between Component with Shared service- A way to share data between component

preview_player
Показать описание
In this video, We are going to learn how we can have interaction between components via shared service.

If you have not seen my first video about Interaction between Component with @Input and @Output in Angular and then I would highly recommend it to see that video. Following is a link to that video.

After that, I have injected this service into two different components and subscribe to current message observable. I have also created a button click event in both components which calls the Change message method from shared service. As we have subscribed to both our message observable it will reflect in message change in both components.

I hope you like this video. If you like this video and want to support this channel. Please do subscribe to my channel

Below is the link

Follow me on:
==================================
Рекомендации по теме
Комментарии
Автор

Excellent tutorial! Thank you, this is the first one I've found that gave me exactly what I needed to know, very concise!

elizabeths.
Автор

I am trying to pass user object but it is not working...but I am getting empty object

maheshbabunadigoti