I need to listen for an event from an array of tab components. These tabs emit "onMinimized" however I would rather hook up to these events in one line of code than entering (onMinimized)="hide"
for each tab component entry in the template. There is an array of ContentChildren that I have which I can loop through.
I want to do something similar to has follows in the parent:
@ContentChildren(TabComponent) tabs: QueryList<TabComponent>;
...
ngAfterContentInit() {
this.tabs.map((t: TabComponent) => {
t.addEventListener("onMinimized", this.hide);
});
}
hide() {
// hide tabs
}
Thoughts?