如何解决如何将数据注入表Angular 10
我想用新的过滤器选项将数据表转换成一个新的表。
这是旧表中的代码:
<tbody fd-table-body>
<tr *ngFor="let row of sortedInstallations" fd-table-row style="cursor: grab;" (click)="redirectToDetails(row)">
<ng-container *ngFor="let tableHeader of tableColumns">
<ng-template #noPropertyValue>
-
</ng-template>
<td fd-table-cell *ngFor="let formatter of tableHeader.formatters">
<ng-container *ngIf="tableHeader.fetchFunction(row) as value; else noPropertyValue">
<ng-container *ngIf="formatter === 'SIMPLE'">
{{ value }}
</ng-container>
<ng-container *ngIf="formatter === 'DATE'">
{{ value | date: 'mediumDate' }}
</ng-container>
<ng-container *ngIf="formatter === 'TIME'">
{{ value | date: 'mediumTime' }}
</ng-container>
<ng-container
*ngIf="formatter === 'STATUS'"
[ngTemplateOutlet]="statusIconAndLabel"
[ngTemplateOutletContext]="{ status: value }"
>
</ng-container>
<ng-container *ngIf="formatter === 'PROGRESSBAR'">
<mat-progress-bar [value]="value * 100" [ngClass]="{ 'progress-bar-executing': true }"></mat-progress-bar>
</ng-container>
</ng-container>
</td>
</ng-container>
</tr>
</tbody>
新表格模板:
<tbody fd-table-body>
<tr *ngFor="let row of displayedRows | filterTableBy: filterVal" fd-table-row>
<td fd-table-cell class="fd-has-font-weight-semi">
<a href="#">{{ value }}</a>
</td>
<td fd-table-cell>{{ value }}</td>
<td fd-table-cell>{{ value | date: 'mediumDate' }}</td>
<td fd-table-cell>{{ row.date }}</td>
<td fd-table-cell>{{ row.date }}</td>
<td fd-table-cell><fd-icon [glyph]="row.type"></fd-icon></td>
</tr>
</tbody>
我尝试将插值复制到新表中,但是出现编译错误。 您能协助亲爱的同事们解决这个话题吗?
提前谢谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。