我想在当前列的值上添加一个条件。我无法读取当前行的值。我不知道我必须使用什么变量来检查我使用的行但未定义的条件
<ng-container matColumnDef="idCve">
<th mat-header-cell matHeaderCellDef mat-sort-header> IDCVE </th>
<ng-container ngIf="row.idCve != null; else dothis" >
<td mat-cell matCellDef="let row"> {{row.idCve}} </td>
</ng-container>
<ng-template #dothid>
<td mat-cell matCellDef="let row"> --------- </td>
</ng-template>
</ng-container>
Run Code Online (Sandbox Code Playgroud)
TS文件
Constructor(vulnerabilityServiceService: VulnerabilityServiceService) {
const vulnerabilities = vulnerabilityServiceService.getVulnerabilities();
// Assign the data to the data source for the table to render
this.dataSource = new MatTableDataSource(vulnerabilities);
}
Run Code Online (Sandbox Code Playgroud)