For example, if I have this structure:
<parent-component>
<child-a class="a"></child-a>
<child-a class="b selected"></child-a>
<child-b class="c"></child-b>
<child-b class="d"></child-b>
...
</parent-component>
How do I access the instance of ChildA with class ".selected" in my ParentComponent?
EDIT:
In ParentComponent I have a list of 10 objects (in property items), and in its template I loop over the items array, and create ChildA or ChildB component for every item (whether ChildA or ChildB depends on some config in item).
Then by clicking on any item I mark it as 'selected' (the corresponding object in the items is stored as selectedItem). Later I need to access the component, that corresponds to the selectedItem (and has ".selected" class").
@ContentChildto select it. e.g.<child-component-a #childB class="b"></child-component-a>