title: Angular 2: How to load TemplateRef from external file
body: <p>I'm creating grid component with customizable cells config.
  Currently, for being able to set custom cell component in cell config, I'm storing whole bunch of templates in view, like so:</p>
  
  <pre><code>&lt;template let-row="row" #nameCell&gt;
    &lt;name-cell [row]="row"&gt;&lt;/name-cell&gt;
  &lt;/template&gt;
  </code></pre>
  
  <p>Getting template in view and storing in grid config:</p>
  
  <pre><code>  @ViewChild('nameCell') nameCell: TemplateRef&lt;any&gt;;
    ...
    column.customCell = nameCell
  </code></pre>
  
  <p>And than using this template in grid cell:</p>
  
  <pre><code>    &lt;template
        *ngIf="column.customCell"
        [ngTemplateOutlet]="column.customCell"
        [ngOutletContext]="{ row: row}"&gt;
      &lt;/template&gt;
  </code></pre>
  
  <p>This works, but looks messy and dirty.
  Is there way to load TemplateRef dynamically from external file?</p>