How to use pipe in ts not HTML
<p>I adding text into html element from ts</p>

<p>like this</p>

<pre><code>this.legend.append('text')
  .attr('x', legendRectSize + legendSpacing)
  .attr('y', legendRectSize - legendSpacing)
  .text(function(d) { return d; });
</code></pre>

<p>this will create html like </p>

<pre><code>&lt;text&gt;Data will come here&lt;/text&gt;
</code></pre>

<p>I want to use pipe to convert this data into some form
how can I do that from ts code ?</p>

<p>and as I am creating this HTML dynamically I cannot use pipe like this </p>

<pre><code>&lt;text&gt;{{Data will come here | pipename}} &lt;/text&gt;
</code></pre>

<p>I am looking for somethig like </p>

<pre><code>this.legend.append('text')
  .attr('x', legendRectSize + legendSpacing)
  .attr('y', legendRectSize - legendSpacing)
  .text(function(d) { return d; }).applypipe('pipename');
</code></pre>