R. Mosser
R. Mosser

Reputation: 21

Angular Material Data Table not displayed

Hi I have the following problem. I made an Angular Material table as in the example provided on the documentation site. My problem is now the table is rendered and also the right amount of rows is rendered but no columns and no data is displayed.

<div class="app-errors">
   <div class="spinner-container" *ngIf="dataSource.loading$ | async">
     <mat-spinner></mat-spinner>
   </div>
   <mat-table [dataSource]="dataSource">
     <ng-container matColumnDef="seqNo" >
        <mat-header-cell *matHeaderCellDef>#</mat-header-cell>
        <mat-cell *matCellDef="let data">{{data.id}}</mat-cell>
     </ng-container>

     <mat-header-row  *matHeaderRowDef="displayedColumns"></mat-header-row>
     <mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
   </mat-table></div>

Rendered:

<app-errors _nghost-c4="" class="ng-star-inserted">
 <div _ngcontent-c4="" class="app-errors">
   <!---->
   <mat-table _ngcontent-c4="" class="mat-table" role="grid"><!----><!---->
      <mat-row _ngcontent-c4="" class="mat-row ng-star-inserted" role="row">
           <!---->
      </mat-row>
   </mat-table>
  </div>
 </app-errors>

Upvotes: 0

Views: 979

Answers (1)

R. Mosser
R. Mosser

Reputation: 21

Problem solved. Created a new project with the exact same configuration copied everything in there now it works. Very strange behavior

Upvotes: 1

Related Questions