【发布时间】:2021-06-24 13:43:35
【问题描述】:
我正在尝试有条件地显示我的 mat-table 的 footer-row。
基于this discussion,我知道不知何故,我必须使用removeFooterRowDef 来删除它,我猜想addFooterRowDef 或setFooterRowDef 带来另一个。
但我找不到关于如何使用其中之一的正确解释。
请注意,我已尝试将页脚行包装在 ng-container 中。
<ng-container *ngIf="hasFooter">
<tr mat-footer-row *matFooterRowDef="footerRowDef"></tr>
<ng-container>
但即使hasFooter 为假,该行仍然存在。
【问题讨论】:
标签: angular angular-material mat-table