Angular 如何为具有动态列数的PrimeNG表中的某些列使用日期管道

Angular 如何为具有动态列数的PrimeNG表中的某些列使用日期管道,angular,typescript,primeng,Angular,Typescript,Primeng,我尝试显示动态的列数,并且尝试使用这样的尝试 this.cols=[ {字段:'no',标题:'no',宽度:'50px',管道:null}, {字段:'createdDate',标题:'createdDate',宽度:'175px',数据:true,格式:'dd/MM/yyyy`, {字段:'deviceName',标题:'deviceName',宽度:'150px'} ]; 模板 {{col.data?(rowData[col.field]|日期:col.format):rowData[

我尝试显示动态的列数,并且尝试使用
这样的尝试

this.cols=[
{字段:'no',标题:'no',宽度:'50px',管道:null},
{字段:'createdDate',标题:'createdDate',宽度:'175px',数据:true,格式:'dd/MM/yyyy`,
{字段:'deviceName',标题:'deviceName',宽度:'150px'}
];
模板


{{col.data?(rowData[col.field]|日期:col.format):rowData[col.field]}

demo@BinaraThambugala我已经更新了答案有一个打字错误
{{col.data?(rowData[col.field]| date:col.format):rowData[col.field]}
@BinaraThambugala你检查了我更新的答案了吗,你还有问题吗?@BinaraThambugala我将创建一个demo@BinaraThambugala |我已经创建了一个demo,它工作正常
<ng-template pTemplate="body" let-rowData let-columns="columns">
      <tr>
        <td *ngFor="let col of columns" [style.width]="col.width">
          {{rowData[col.field]| col?.pipe}}
        </td>
      </tr>
</ng-template>
 this.cols = [
      { field: 'no', header: 'No.', width: '50px',pipe:null },
      { field: 'createdDate', header: 'createdDate', width: '175px', pipe: 'date: \'dd/MM/yyyy\''},
      { field: 'deviceName', header: 'Device Name', width: '150px'}
    ];