Hey there, I could really use some assistance. I have this data stored in a filteredData variable within a MatTableDataSource.
My goal is to display this data in two separate tables, but I'm encountering issues where nothing is being shown.
In my component.ts file, I have the following:
ngOnInit(): void {
this.Groups();
}
Groups(){
this.apiSvc.Cards().subscribe((rsp: any) => {
this.groups = rsp;
});
this.apiSvc.Cards().pipe(
switchMap((rsp:any[])=>{
return forkJoin(
rsp.map(x=>this.apiSvc.Groups(x.id))
)
})
).subscribe((res:any[])=>{
this.dataSource = new MatTableDataSource(res);
this.dataSource.paginator = this.paginator;
console.log(this.dataSource);
})
Furthermore, here's what I've included in my component.html:
<table mat-table [dataSource]="dataSource" class="table employee-list no-wrap">
<ng-container matColumnDef="#">
<th mat-header-cell *matHeaderCellDef> ID </th>
<td mat-cell *matCellDef="let element"> {{element.usersid}} </td>
</ng-container>
</table>
My aim is to arrange the IDs based on the filteredData image order, potentially using ngFor for future data expansion, but I'm unsure how to accomplish this task.
If anyone can provide guidance or assistance, I would be truly grateful. Thank you.