Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
failed loading a component inside a table in angular using Material table

I have a table component <app-root-table></app-root-table>

and want to insert inside the table a feature component <app-table-insert></app-table-insert>


<table mat-table [dataSource]="tableData$" class="mat-elevation-z8">
  <ng-container
    matColumnDef="{{ column }}"
    *ngFor="let column of tableColumnNames$ | async"
  >
    <th mat-header-cell *matHeaderCellDef>{{ column }}</th>
    <td mat-cell *matCellDef="let element">{{ element[column] }}</td>
  </ng-container>

  <tr mat-header-row *matHeaderRowDef="tableColumnNames$ | async"></tr>

  <app-table-insert
    [tableData$]="tableData$"
    [tableColumnNames$]="tableColumnNames$"
  ></app-table-insert>

  <ng-container *ngIf="false">
    <tr
      mat-row
      *matRowDef="let row; columns: tableColumnNames$ | async"
      class="example-detail-row"
    ></tr>
  </ng-container>
</table>


the component gets loaded but does not appear in the DOM , why ?

stackblitz

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

MatTable selects for specific directives within its ng-content. Unfortunately, you can't add just any tag and have it displayed (try this with a p tag or just some plain text).

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!