Reputation: 127
@ViewChildren(Subcomponent) sComp;
Will get me the Subcomponent children of my current component, but I want to get the values of elements that are children of Subcomponent. How do I do that?
Upvotes: 0
Views: 390
Reputation: 8478
In Subcomponent
you can have a method defined to return it's child:
@ViewChildren(ChildA) childAOfSubcomponent;
getChildA() {
return this.childAOfSubcomponent;
}
Now in current component use this:
this.sComp.getChildA(); // thi will return child of SubComponent
Upvotes: 3