I would like to know if I can place the mat table rows in another component different from the table component, here is an example:
<mat-table #table [dataSource]="dataSource" class="table" matSort>
<user-table-row> </user-table-row>
<ng-container matColumnDef="profile">
<mat-header-cell *matHeaderCellDef mat-sort-header class="header-cell"> Profile Type </mat-header-cell>
<mat-cell *matCellDef="let user" class="cell"> {{user.profile.type}} </mat-cell>
</ng-container>
<ng-container matColumnDef="status">
<mat-header-cell *matHeaderCellDef mat-sort-header class="header-cell"> Status </mat-header-cell>
<mat-cell *matCellDef="let user" class="cell"> {{user.profile.status}} </mat-cell>
</ng-container>
<!-- Header and Row Declarations -->
<mat-header-row *matHeaderRowDef="['createdAt', 'email', 'profile', 'status', 'isApproved', 'actions']" class="header-row"></mat-header-row>
<mat-row *matRowDef="let row; columns: ['createdAt', 'email', 'profile', 'status', 'isApproved', 'actions']" class="row"></mat-row>
</mat-table>
How do I make something like this:
<mat-table #table [dataSource]="dataSource" class="table" matSort>
<user-table-row> </user-table-row>
</mat-table>
Is it possible, anyone have done this before?