ng-template不会在dataTable

时间:2019-04-19 21:21:50

标签: angular angular-datatables

我正在使用Firebase进行角度处理。我创建了产品列表的数据表,并有3列,分别是标题,价格和编辑产品的链接。 问题在于 ng-template 中包含的数据无法呈现。

我已经尝试了下面提到的代码,但是找不到它出了什么问题,也没有在终端或chrome控制台中得到任何错误。


    <data-table
      [items]="items"
      [itemCount]="itemCount"
      (reload)="reloadItems($event)"
    >
      <data-table-column
        [property]="'title'"
        [header]="'Title'"
        [sortable]="true"
        [resizable]="true"
      ></data-table-column>

      <data-table-column
        [property]="'price'"
        [header]="'Price'"
        [sortable]="true"
        [resizable]="true"
      >
        <ng-template #dataTablCell let-item="item">
          {{ item.price | currency:'INR':'symbol' }}
        </ng-template>
      </data-table-column>

      <data-table-column
        [property]="'key'"
      >
        <ng-template #dataTablCell let-item="item">
            <a [routerLink]="['/admin/products/', item.key]">Edit</a>
        </ng-template>
      </data-table-column>

    </data-table>

  

        {{item.price |货币:'INR':'符号'}}       

     

          编辑       

它应该在每个第三列中显示每个产品的 INR符号和价格,并显示一个名称为'Edit'的链接。价格显示时没有INR符号,并且显示了与每个产品关联的Firebase中的实际键,而不是“编辑”链接。

请参考以下屏幕截图:

This is the expected result

This is the result I got

0 个答案:

没有答案