title: Angular 2/4: Add compiled component to an iframe
body: <p>I have a new Angular app (can use v 2.4.10 or 4.0.0-rc.5), which uses an iframe to embed some pre-existing content. Using a method called when the iframe loads -- <code>(load)="processIframe(extFrame)"</code> -- I'm able to set up listeners via the Angular Renderer, and to grab references to child DOM elements (<a href="https://stackoverflow.com/a/38457886/2924969">this answer</a> helped with that process).</p>
  
  <p>It's easy enough to set the content of an element in the iframe by replacing its <code>innerHtml</code>. However, what I need to do is the replace this html with a compiled Angular component. This component grabs some data from an API via a service.</p>
  
  <p>Is there a way to replace DOM element content in the iframe with the compiled component?</p>