title: How to convert string to an template reference instance?
body: <p>I'm setting up ngTemplateOutlet inside *ngFor like in below code snippet</p>
  
  <pre><code>  &lt;ul&gt;
      &lt;li *ngFor="let item of list"&gt;
        &lt;ng-container [ngTemplateOutlet]="item.type"&gt;&lt;/ng-container&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  </code></pre>
  
  <p>Where <code>list = [ {type: 'templateOne'}, {type: 'templateTwo'} ]</code> and i have defined templates like below.</p>
  
  <pre><code>&lt;ng-template #templateOne&gt;&lt;/ng-template&gt;
  &lt;ng-template #templateTwo&gt;&lt;/ng-template&gt;
  </code></pre>
  
  <p>The above template snippet is throwing error with message undermentioned</p>
  
  <pre><code>TypeError: templateRef.createEmbeddedView is not a function
      at ViewContainerRef_.push../node_modules/@angular/core/fesm5/core.js.ViewContainerRef_.createEmbeddedView (core.js:21600)
      at NgTemplateOutlet.push../node_modules/@angular/common/fesm5/common.js.NgTemplateOutlet.ngOnChanges (common.js:4026)
      at checkAndUpdateDirectiveInline (core.js:22085)
  </code></pre>
  
  <p>Since <code>item.type</code> used in <code>ngTemplateOutlet</code> is of type string i am suspecting it is not getting resolved to templateReference variable.</p>
  
  <p>How can i convert string to a templateReference instance?</p>
  
  <p>Demonstration - <a href="https://stackblitz.com/edit/ng-template-outlet-kps7sl" rel="nofollow noreferrer">See this link for example and verify console for the error</a></p>