title: angular2 ng-template in a separate file
body: <p>angular2 how to use ng-template from a different file? When I place the ng-template within the same HTML where I use it works but when I move ng-template into a separate file then it won't work. Is there a way to move ng-template into its own file and use it in different html file?</p>
  
  <p><strong>info-message.html</strong></p>
  
  <pre><code>&lt;ng-template #messageTemplate&gt;
      Hi
  &lt;/ng-template&gt;
  
  &lt;ng-container *ngTemplateOutlet="messageTemplate;"&gt;&lt;/ng-container&gt;
  </code></pre>
  
  <p>above is working fine because ng-template and the usage is in same file</p>
  
  <p><strong>message-template.html</strong></p>
  
  <pre><code>&lt;ng-template #messageTemplate&gt;
      Hi
  &lt;/ng-template&gt;
  </code></pre>
  
  <p><strong>info-message.html</strong></p>
  
  <pre><code>&lt;ng-container *ngTemplateOutlet="messageTemplate;"&gt;&lt;/ng-container&gt;
  </code></pre>
  
  <p>This is not working. Is there a way to use <strong>"messageTemplate"</strong> which is in a separate file inside another html(Eg: info-message.html)</p>
  
  <p>Thanks in advance.</p>