title: Angular 6 - router-outlet - Loading external HTML with CSS
body: <p>I am trying to develop json based dynamic template using Angular 6.</p>
  
  <p>There are some use cases where I would like to load external html (might be from DB as a text ) with css (as a separate file as a text from DB) and use this for the corresponding router-outlet html.</p>
  
  <p>For ex, We need to have a home.html and home.ts file for the below routing. Instead of having the html code inside home.html, I thought of loading from DB as a text and show the same. Here, I would like to get the corresponding css code also from DB without hard-coding css code in html. </p>
  
  <p>Also, I need the corresponding JavaScript functions (say for dynamic html, i may have a delete link or cancel link) in a separate file. It would be similar to typescript. Can I load typescript file also dynamically?</p>
  
  <pre><code>const routes: Routes = [
    { path: '', redirectTo: 'home', pathMatch: 'full' }
  ]
  </code></pre>
  
  <p>I can go with the below approach.</p>
  
  <p><a href="https://stackoverflow.com/questions/17636528/how-do-i-load-an-html-page-in-a-div-using-javascript">How do I load an HTML page in a &lt;div&gt; using JavaScript?</a></p>
  
  <p>But, trying to understand if there is any better approach for Angular 6.</p>