title: Display [object HTMLElement] as HTML in Angular
body: <p>I have a directive, and I am trying to change the innerHTML of an HTMLobject.</p>
  <pre class="lang-js prettyprint-override"><code>let icon: HTMLElement;
  let attribute = document.createAttribute('icon');
  icon = document.createElement('fa-icon');
  attribute.value = &quot;home&quot;;
  icon.setAttributeNode(attribute);
   
  this.elementRef.nativeElement.innerHTML = icon;
  </code></pre>
  <p>It does work, but when I see the changes it always displays  <em>[object HTMLElement]</em> instead of the html that should be a fontAwesome icon.</p>
  <p>What am I doing wrong and how would I insert the icon variable?</p>