【发布时间】:2017-01-08 05:47:02
【问题描述】:
我正在尝试构建一个动态表,我想在 运行时 中决定使用哪个管道(如果有)。
我正在尝试实现类似于(简化):
export class CellModel {
public content: any;
public pipe: string
}
表格
<tbody>
<tr *ngFor="let row of data">
<template ngFor let-cell [ngForOf]=row>
<td *ngIf="cell.pipe">{{cell.content | cell.pipe}}</td>
<td *ngIf="!cell.pipe">{{cell.content}}</td>
</tr>
</tbody>
我知道这个例子给出了一个错误。我可以使用 Reflect 是某种方式或其他解决方案吗?
【问题讨论】:
标签: angular angular2-pipe