首页 > 解决方案 > 带有 ngFor 的 tbody 不可见

问题描述

在我的主要组件中,我得到了一个带有 ngFor 的 tbody,它应该将元素发送到另一个应该显示元素项的组件。

这是我的主要组件

<app-clazz-buttons (clicked)="onClazzButtonClicked($event)"></app-clazz-buttons>
<br>
<table id="tblStudents">
  <thead>
    <th>Geschlecht</th>
    <th>Name</th>
    <th>Alter</th>
    <th>Reg</th>
    <th>Klasse</th>
</thead>
  <tbody *ngFor="let student of students"
  app-student-row
  [student]="student">
  </tbody>
</table>
<router-outlet></router-outlet>

这是另一个组件

<tr>
<td>{{student.id}}</td>
<td>{{student.gender}}</td>
<td>{{student.lastname}} {{student.firstname}}</td>
<td>{{student.age}}</td>
<td>{{student.registered}}</td>
<td>This will come soon</td>
</tr>

标签: htmlangularhtml-tbody

解决方案


推荐阅读