title: Angular2 include html from server into a div
body: <p>I got a serie of html in my server. For example:</p>
  
  <ul>
  <li><p><a href="http://docs.example.com/intro.html" rel="noreferrer">http://docs.example.com/intro.html</a></p></li>
  <li><p><a href="http://docs.example.com/page1.html" rel="noreferrer">http://docs.example.com/page1.html</a></p></li>
  <li><p><a href="http://docs.example.com/page2.html" rel="noreferrer">http://docs.example.com/page2.html</a></p></li>
  </ul>
  
  <p>And I trying to include those files into a<code>&lt;div&gt;</code> in my angular2 v4 app. For example:</p>
  
  <p>component.ts</p>
  
  <pre><code>public changePage(name: string) {
    switch (name) {
      case 'intro': this.myHtmlTemplate = 'http://docs.example.com/intro.html'; break;
      case 'page1': this.myHtmlTemplate = 'http://docs.example.com/page1.html'; break;
      case 'page2': this.myHtmlTemplate = 'http://docs.example.com/page2.html'; break;
    }
  }
  </code></pre>
  
  <p>component.html</p>
  
  <pre><code>&lt;div [innerHtml]="myHtmlTemplate"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>but it doesnt work. I tried the following solutions:</p>
  
  <p><a href="https://stackoverflow.com/questions/46659860/angular4-load-external-html-page-in-a-div">Angular4 Load external html page in a div</a></p>
  
  <p><a href="https://stackoverflow.com/questions/40786490/dynamically-load-html-template-in-angular2">Dynamically load HTML template in angular2</a></p>
  
  <p>but it doesn't work for me. Can somebody help me with this problem please ?</p>