Answer the question
In order to leave comments, you need to log in
How can you pass data from one child component to another?
Hello. I just started learning Angular. There was a question of transferring data from one child component to another child component (from a method of one component, a method is triggered in another). I know that data is transferred using Iput, Output, VievChild and so on. Unfortunately, I do not know how best to transfer data in my case. I would be grateful for practical examples of how these directives work or links to examples. Thank you in advance.
Answer the question
In order to leave comments, you need to log in
Zayuzay dependency injection
In the parent component, you make provide of your own type, inherited from subject, in the child in the constructor you use the same instance and prescribe for changes. For some reason, few people use this approach, apparently due to poor documentation.
If data is needed throughout the application, user token, nickname - then statement with offline second - redux and localforage for example, otherwise Subject.
Look at app/service/message.service and loader.service here - https://bitbucket.org/furrya_black/cake-shop
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question