I'm working on a simple mat-table where the user can accept or reject rows within 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>
My goal is to hide the accept and reject buttons when a row has already been accepted or rejected.
I attempted to achieve this using:
document.getElementById("accept").style.visibility = "hidden';
and also tried:
document.getElementById("accept").style.display = 'none';
However, both methods resulted in an error "Cannot read property 'style' of null".
If more information is needed to help answer my question, please let me know.
Thank you.