I have one parent component and multiple child components.
<parent>
<child1></child1>
<child2></child2>
...
</parent>
In order to communicate between parent child either I can make use of event decorators (@Input/@Output)
. Alternately I can make use of multiple @ViewChild
like below to access child properties and methods. (Not considering services and Observables)
@ViewChild('child1') child1: Child1;
@ViewChild('child2') child2: Child2;
//.... so on
I dont want to use event decorators as well as multiple @ViewChild to store the reference of each child components.
Is there any way in angular similar to @ViewChild where I can get the reference of all the child's in one variable and I can iterate on to that variable to access the properties and methods of each child ?
Any help is appreciated !!!