[英]Apply css class to a <div> generated by an <ng-template> within the <ngx-datatable-column>
[英]usage of ngFor with ng template in ngx-datatable-column
我在這里遇到了一個問題,我的 ngFor 沒有顯示任何數據,盡管沒有堆棧錯誤或其他什么。
我想知道如何顯示我的對象數組 - 稱為“cldbAccounts” - 它必須對象並在同一列中顯示它們的兩個屬性。
我那部分的代碼
<ngx-datatable-column *ngIf="mode === 'contract' || mode === 'factorer'" name="CldbAccount" prob="cldbAccount">
<ng-template let-column="column" height="200" let-onSort="sortFn" ngx-datatable-header-template>
<span class="datatable-header-cell-wrapper">
<span class="datatable-header-cell-label draggable" (click)="onSort()">CldbAccount</span>
</span>
</ng-template>
<ng-template ngFor let-cldbAccount [ngForOf]="cldbAccounts">
{{ cldbAccount.cldbAccount.cldbAccount }} [{{ cldbAccount.debitor.name }}]
</ng-template>
</ngx-datatable-column>
我也試過這個答案的解決方案見here但存在同樣的問題
我發現問題只是我的代碼中的一個錯字,其中prob="cldbAccount"
應該是prop="cldbAccount"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.