How to pass value from child to parent?
I'm trying to make a connection 1.descendant - 2.parent - 3.descendant.
Two of the offspring are inherited from 1 parent, but the data should be transferred first with one child in the parent and then from parent to offspring, because the descendants are not connected.
The link from parent to descendant I can do there I use @Input():
@Input() isSearch: boolean = false;
the parent get it this give
Question to me from another descendant to pass this value headerSearch parent?
I hope I'm clearly written. As I understand there @Output() - but it is to listen to events, and I at boot just have to pass the boolean value
asked July 2nd 19 at 17:03
Can be done through the service. Creates an instance of the service where the value is stored. One descendant associated with services by means of data binding, the second requests via the method.
yeah, and using @Output()
Find more questions by tags Angular