title: Render view inside iframe in Angular 6 and continue to use template variables
body: <p>In angularJS, you could use $compile to render a view in an iframe as well as keep the angularjs $scope variables within the iframe. Is there an equivalent functionality in Angular.IO?</p>
  
  <p>AngularJS equivalent in a directive: </p>
  
  <pre><code>var $body = angular.element($element[0].contentDocument.body);
  var template = $compile(contents)($scope);
  $body.append(template);
  </code></pre>
  
  <p>I would like to render an iframe, pass the necessary html to populate the iframe and be able to use the template language inside the iframe html.</p>
  
  <p>Similar to this but, <a href="https://embed.plnkr.co/CoFXp3/" rel="noreferrer">this plunkr</a> isn't working. It doesn't render the variables in the iframe view.</p>
  
  <p>Update: Found some tutorials on how to use angularJS in typescript and that might work. Ultimately, I would like to share variables between the parent and iframe, similar to how $scope in angularJS can be shared between parent and iframe.</p>