component inside iframe angular2
<p>Is there a way to include a component inside an iframe in Angular 2?</p>

<p>This code doesn't work (it should render the angular component called component-b inside the iframe): </p>

<pre><code>  var doc = document.getElementById('iframe').contentWindow.document;
    doc.open();
    doc.write('&lt;component-b&gt;&lt;/component-b&gt;');
    doc.close();
</code></pre>

<p>This code works (it renders a simple button inside the iframe):</p>

<pre><code> var doc = document.getElementById('iframe').contentWindow.document;
    doc.open();
    doc.write('&lt;button&gt;&lt;/button&gt;');
    doc.close();
</code></pre>