I am given a component class with the following definition:
@component({
selector: 'app-table',
template: '<div #content></div>',
styleUrls: ['./table.component.css']
});
export class TableComponent implements OnInit{
@ViewChild('content') elm: ElementRef;
....
}
However, in the parent html, the structure is:
<div label="summary1">
<app-table type="thisMonth"></app-table>
</div>
<div label="summary2">
<app-table type="lastMonth"></app-table>
</div>
My question is, how can I put generate different content and put into the corresponding 'app-table'?
I tried to use the following method and it returns undefined:
export class TableComponent implements OnInit{
@ViewChildren('content') elms: <QueryList>ElementRef;
Thank you!