title: How to render a HTML string with a directive
body: <p>I have a use case where I need to render and transform an HTML node to HTML string and then add a ngx-bootstrap tooltip directive on a specific element in that that HTML string. </p>
  
  <p>I can get the HTML to render fine, by either using InnerHTML with a pipe or creating a separate component, but always after the HTML is rendered the tooltip directive on the element is not registered and I'm not sure where to go from here. I would have though using <code>pure: false</code> on the PIpe would solved it, but it does not.</p>
  
  <p>Here is what've I tried with a pipe:</p>
  
  <h2>The Pipe With Tooltip Directive</h2>
  
  <pre><code>import { documentToHtmlString } from '@contentful/rich-text-html-renderer';
  import { Pipe, PipeTransform } from '@angular/core';
  import { DomSanitizer } from '@angular/platform-browser';
  import { BLOCKS, INLINES } from '@contentful/rich-text-types';
  import { Store } from '@ngxs/store';
  import { DeckState } from '../__states/deck';
  
  @Pipe({ name: 'rich', pure: false })
  export class RichContent implements PipeTransform {
    constructor(private sanitizer: DomSanitizer, private store: Store) {
    }
  
    transform(content) {
  
  
      let options = {
        renderNode: {
          [INLINES.EMBEDDED_ENTRY]: (node) =&gt; {
            return `&lt;b [tooltip]="node.data.target.fields.companyName"&gt;${node.data.target.fields.companyName}&lt;/b&gt;`
          }
        }
        }
  
        var html = documentToHtmlString(content, options);
  
        return this.sanitizer.bypassSecurityTrustHtml(html);
  
    }
  }
  </code></pre>
  
  <h2>The HTML</h2>
  
  <pre><code>&lt;div [innerHTML]="content | rich"&gt;&lt;/div&gt;
  </code></pre>
  
  <h2>Outcome</h2>
  
  <p>Plain HTML without the tooltip directive working or being registered.
  For example: </p>
  
  <pre><code>&lt;p&gt;Here is an example from &lt;b [tooltip]="node.data.target.fields.companyName"&gt;Mixpanel&lt;/b&gt;&lt;/p&gt;
  </code></pre>
  
  <p>Hope someone can help me and point me in the right direction to solve this.</p>