title: How to use document.write in Angular 2
body: <p>In my normal HTML page I am having a simple 4 line code shown below:</p>
  
  <pre><code>&lt;script&gt;
  var getData = JSON.parse(localStorage.getItem("templateType"));
  document.write(getData.template_code); // in angular its wriiten as getData["template_code"]
  console.log(getData.template_code);
  document.getElementById("main-wrapper").innerHTML = getData.template_code;
  &lt;/script&gt;
  </code></pre>
  
  <p>How can I do the same in Angular 2, I have a component <code>webview.component.html</code> and <code>webview.component.ts</code>?</p>