【发布时间】:2021-04-30 09:40:44
【问题描述】:
我正在尝试遍历从 API 请求中获取的列表,并将数据插入到表中。我的问题是,该表位于 ng-template 标记内,我不知道如何处理。
这是我的代码:
<ng-template>
<table>
<thead>
<tr>
<th>Reference</th>
<th>Chapter</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let ref of data">
<td>{{ref.title}}</td>
<td>{{ref.chapter}}</td>
</tr>
</tbody>
</table>
</ng-template>
这是我的目标: Popover
【问题讨论】:
-
为什么它在
ng-template里面? -
因为,在弹出窗口中很合适
标签: angular ngfor ng-template