Below is my d3 code snippet:
grouping.append('foreignObject').html(function (d) {
var string = '<p>hello, {{ "there" }} <some-directive></some-directive></p>';
string = $compile(string)(scope);
return string;
});
The issue I'm facing is that string
ends up as an HTML object instead of just a string which is required by d3. I attempted to convert it to text using the XMLSerializer, but this resulted in the original string
without compilation.
In essence, I need to compile certain elements and output them as a string for the d3 method. Any suggestions on how I can achieve this?