title: Angular: Best/recommended way to pass template to child component
body: <p>I was wondering what the best or recommended way is to pass templates to child components. As far as I can see there are basically 3 ways to do this:</p>
  
  <h1>Option 1</h1>
  
  <p><strong>parent.html</strong></p>
  
  <pre><code>&lt;ng-template #mytemplate&gt;
    &lt;!-- some stuff --&gt;
  &lt;/ng-template&gt;
  
  &lt;child [stuff]="myTemplate"&gt;&lt;/child&gt;
  </code></pre>
  
  <p><strong>child.ts</strong></p>
  
  <pre><code>@Input() public stuff: TemplateRef&lt;any&gt;;
  </code></pre>
  
  <p><strong>child.html</strong></p>
  
  <pre><code>&lt;ng-container [ngTemplateOutlet]="stuff"&gt;&lt;/ng-container&gt;
  </code></pre>
  
  <h2>Option 2</h2>
  
  <p><strong>parent.html</strong></p>
  
  <pre><code>&lt;child&gt;
    &lt;ng-template #mytemplate&gt;
      &lt;!-- some stuff --&gt;
    &lt;/ng-template&gt;
  &lt;/child&gt;
  </code></pre>
  
  <p><strong>child.ts</strong></p>
  
  <pre><code>@ContentChild(TemplateRef) layoutTemplate: TemplateRef&lt;any&gt;;
  </code></pre>
  
  <p><strong>child.html</strong></p>
  
  <pre><code>&lt;ng-container *ngTemplateOutlet="layoutTemplate"&gt;
  &lt;/ng-container&gt;
  </code></pre>
  
  <h1>Option 3</h1>
  
  <p><strong>parent.html</strong></p>
  
  <pre><code>&lt;child&gt;
    &lt;!-- some stuff -&gt; not ng-template around it! --&gt;
  &lt;/child&gt;
  </code></pre>
  
  <p><strong>child.ts</strong></p>
  
  <pre><code>// nothing required
  </code></pre>
  
  <p><strong>child.html</strong></p>
  
  <pre><code>&lt;ng-content&gt;&lt;/ng-content&gt;
  </code></pre>
  
  <p>I was not able to find anything in the docs on what the "standard" way is. 
  Is it just taste? Are there benefits for one of them that should make it the default way?</p>
  
  <p>Of course there are always use cases where one or the other is better suited. But I am interested in cases like the example above - where all of them could be used.</p>
  
  <p>Is there already some documentation or recommendation given somewhere? It seems that the examples that you find when searching for "how to pass template to child" are more likely to use Option 2. But why? I would guess this is because they tend to show case examples where the template is not only used to pass it to a child but also in the parent itself as well.</p>
  
  <p>Thanks!</p>