I have a simple mat-table, where the user accept or reject the row of the table
<ng-container matColumnDef="accept">
<mat-header-cell *matHeaderCellDef mat-sort-header>accept </mat-header-cell>
<mat-cell *matCellDef="let row">
<button (click)="accept(row)" mat-raised-button id="accept">accept</button>
</mat-cell>
</ng-container>
<ng-container matColumnDef="reject">
<mat-header-cell *matHeaderCellDef mat-sort-header>reject </mat-header-cell>
<mat-cell *matCellDef="let row">
<button (click)="reject(row)" mat-raised-button id="reject">reject</button> </mat-cell>
</ng-container>
So, when the row is already accepted or rejected, those buttons should be hidden
I tried this
document.getElementById("accept").style.visibility = "hidden";
and this
document.getElementById("accept").style.display = 'none';
but they didn't work, I got an error "Cannot read property 'style' of null"
I don't know if the question is clear enough but if you need more information I will provide.
Thank you.