Kendo-Angular 网格仅在单元格值大于零时才显示超链接

Kendo-Angular grid display a hyperlink only if cell value is greater than zero

我有一个 Kendo 网格,其中包含指向单元格值的超链接,如下所示,

点击超链接会根据不同的场景路由到不同的页面

       <kendo-grid-column title="Test3" field="testCount"
            [minResizableWidth]="30" [width]='gridColumnWidth' [filterable]="false" [sortable]="false">
            <ng-template kendoGridCellTemplate let-dataItem>
                <a href="javascript:void(0)"
                    (click)="goToPage(test3)"
                    class="href-color">
                    {{dataItem.testCount}}</a>
            </ng-template>
        </kendo-grid-column>

如何避免计数为零的单元格上的超链接,因为它指向另一页中的无数据网格。

使用 ngIf 有条件地显示锚标记:

<a *ngIf="dataItem.testCount > 0; else noHyperlink"
   href="javascript:void(0)"
   (click)="goToPage(test3)"
   class="href-color">
   {{dataItem.testCount}}</a>
<ng-template #noHyperlink>0</ng-template>