Is there a way to retrieve ViewChildren
or ContentChildren
by element class?
This will work, either by id or component but not for the class based queries, namely classedViewItems
and classedContentItems
@Component({
selector: 'my-container',
template '<div><ng-content><ng-content></div>'
})
export class MyContainer {
@ViewChildren('item') viewItems: QueryList;
@ContentChildren(MyItem) contentItems: QueryList;
@ViewChildren('.fine-me') classedViewItems: QueryList; // <-- need this to work
@ContentChildren('.find-me') classedContentItems: QueryList; // <-- or this
}
for the following:
<my-container>
<my-item class="find-me" #item *ngFor="let item; of items"></my-item>
</my-container>
I need to get the query list by the element class without decorating it.