【发布时间】:2017-01-31 21:25:21
【问题描述】:
我将文本从 ts 添加到 html 元素中
喜欢这个
this.legend.append('text')
.attr('x', legendRectSize + legendSpacing)
.attr('y', legendRectSize - legendSpacing)
.text(function(d) { return d; });
这将创建像 html 一样的 html
<text>Data will come here</text>
我想用管道把这些数据转换成某种形式 如何从 ts 代码中做到这一点?
当我动态创建这个 HTML 时,我不能像这样使用管道
<text>{{Data will come here | pipename}} </text>
我正在寻找类似的东西
this.legend.append('text')
.attr('x', legendRectSize + legendSpacing)
.attr('y', legendRectSize - legendSpacing)
.text(function(d) { return d; }).applypipe('pipename');
【问题讨论】:
-
请澄清您的问题。我很难理解你在寻找什么。
-
现在可以了吗? @MorKadosh
-
请添加您的完整打字稿代码。
标签: javascript angular pipe