我有一个数据表,其中我显示了分支的数据,但需要用0。
的索引隐藏该项目。 <ngx-datatable
class="data-table table-responsive task-list-table"
[rows]="branches"
[loadingIndicator]="loadingIndicator"
[columnMode]="'force'"
[headerHeight]="50"
[footerHeight]="50"
[limit]="10"
[rowHeight]="66"
[reorderable]="reorderable">
<ngx-datatable-column name="Branch Office Name">
<ng-template let-rowIndex="rowIndex" *ngIf="rowIndex != 0" let-
branch="row" ngx-datatable-cell-template>
{{branch['name']}}
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column name="Parent Branch">
<ng-template let-rowIndex="rowIndex" *ngIf="rowIndex != 0" let-
branch="row" ngx-datatable-cell-template>
{{branch['parentOrganizationName']}}
</ng-template>
</ngx-datatable-column>
</ngx-datatable>
我尝试使用 *ngif指令进行操作,但行不通。我该如何解决?
尝试包装要用跨度显示的数据,然后在跨度标签中使用NGIF:
<ngx-datatable
class="data-table table-responsive task-list-table"
[rows]="branches"
[loadingIndicator]="loadingIndicator"
[columnMode]="'force'"
[headerHeight]="50"
[footerHeight]="50"
[limit]="10"
[rowHeight]="66"
[reorderable]="reorderable">
<ngx-datatable-column name="Branch Office Name">
<ng-template let-rowIndex="rowIndex" let-
branch="row" ngx-datatable-cell-template>
<span *ngIf="rowIndex != 0">
{{branch['name']}}
</span>
</ng-template>
</ngx-datatable-column>
<ngx-datatable-column name="Parent Branch">
<ng-template let-rowIndex="rowIndex" let-
branch="row" ngx-datatable-cell-template>
<span *ngIf="rowIndex != 0">
{{branch['parentOrganizationName']}}
</span>
</ng-template>
</ngx-datatable-column>
</ngx-datatable>