Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

206
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda