title: Create TemplateRef and insert it in component's template
body: <p>Angular 5.0.2
  Based on the example provided on <code>NgTemplateOutlet</code> <a href="https://angular.io/api/common/NgTemplateOutlet" rel="noreferrer">https://angular.io/api/common/NgTemplateOutlet</a></p>
  
  <p>I want to know if there's a way to dynamically create a TemplateRef and then inject it into component's template.</p>
  
  <p>For example let's say a component has the following template</p>
  
  <pre><code>&lt;ng-container *ngTemplateOutlet="eng; context: myContext"&gt;&lt;/ng-container&gt;
  &lt;ng-template #eng let-name&gt;&lt;span&gt;Hello {{name}}!&lt;/span&gt;&lt;/ng-template&gt;
  </code></pre>
  
  <p>component code</p>
  
  <pre><code>class NgTemplateOutletExample {
    myContext = {$implicit: 'World'};
  }
  </code></pre>
  
  <p>What I want is to transform this into a component with the following template</p>
  
  <pre><code>&lt;ng-container *ngTemplateOutlet="eng; context: myContext"&gt;&lt;/ng-container&gt;
  </code></pre>
  
  <p>and component code like this</p>
  
  <pre><code>class NgTemplateOutletExample {
    eng:TemplateRef = this.createTemplateRef('&lt;ng-template #eng let-name&gt;&lt;span&gt;Hello {{name}}!&lt;/span&gt;&lt;/ng-template&gt;');
    myContext = {$implicit: 'World'};
  }
  </code></pre>
  
  <p>Is it possible to create <code>TemplateRef</code> from a string?</p>