title: How to dynamically add innerHTML with angular 2 components
body: <p>I'm creating docs for a component library. I want 1 string of html that generates both the component on the page and the docs for it.</p>
  
  <p>What I want:</p>
  
  <p><a href="https://i.stack.imgur.com/bjp5u.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bjp5u.png" alt="enter image description here"></a></p>
  
  <p>What I have:</p>
  
  <p><a href="https://i.stack.imgur.com/pABg0.png" rel="noreferrer"><img src="https://i.stack.imgur.com/pABg0.png" alt="enter image description here"></a></p>
  
  <p>When I inspect the HTML, my-button tags are not present. They are being stripped out when I use innerHTML.</p>
  
  <p>My component code:</p>
  
  <pre><code>private flatButtons = `&lt;div class="button-wrapper"&gt;
        &lt;my-button [type]="'default'" [raised]="false"&gt;Default&lt;/my-button&gt;
      &lt;/div&gt;
      &lt;div class="button-wrapper"&gt;
        &lt;my-button [type]="'primary'" [raised]="false"&gt;Primary&lt;/my-button&gt;
      &lt;/div&gt;
      &lt;div class="button-wrapper"&gt;
        &lt;my-button [type]="'success'" [raised]="false"&gt;Success&lt;/my-button&gt;
      &lt;/div&gt;
      &lt;div class="button-wrapper"&gt;
        &lt;my-button [type]="'info'" [raised]="false"&gt;Info&lt;/my-button&gt;
      &lt;/div&gt;
      &lt;div class="button-wrapper"&gt;
        &lt;my-button [type]="'warning'" [raised]="false"&gt;Warning&lt;/my-button&gt;
      &lt;/div&gt;
      &lt;div class="button-wrapper"&gt;
        &lt;my-button [type]="'danger'" [raised]="false"&gt;Danger&lt;/my-button&gt;
      &lt;/div&gt;`
  
  constructor() {}
  
  getCode() {
      return html_beautify(this.flatButtons, this.options)
  }
  </code></pre>
  
  <p>My HTML template:</p>
  
  <pre><code>&lt;div class="row"&gt;
  &lt;div class="col-sm-6 col-xs-12"&gt;
    &lt;mi-card title="Flat Buttons" baCardClass="with-scroll button-panel"&gt;
      &lt;div id="flatButtons" [innerHTML]="getCode()"&gt;
      &lt;/div&gt;
    &lt;/mi-card&gt;
  &lt;/div&gt;
  &lt;div class="col-sm-6 col-xs-12"&gt;
    &lt;pre&gt;{{getCode()}}&lt;/pre&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>