title: Angular: Access ViewChild in child component
body: <p>Is it possible to access the content of a child component as a ViewChild? I ask because I would like to create a simpler more reusable dialog based off the Angular Material dialog.</p>
  <p>Something like this would be nice:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;parent-component&gt;
       &lt;child-component&gt;
         Stuff in the child component
       &lt;/child-component&gt;
  &lt;/parent-component&gt;
  </code></pre>
  <p>Above would be nice so I can pass the content of <code>child-component</code> to the Angular Material dialog method to open it kind of like how they do it in <a href="https://stackblitz.com/edit/ng-template-mat-dialog?file=app%2Fapp.component.ts" rel="nofollow noreferrer">this Stackblitz.</a></p>
  <p>As opposed to having to do something like this:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;app-my-content&gt;
    &lt;ng-template #myContent&gt;
      &lt;app-my-other-component&gt;Ouch!&lt;/app-my-other-component&gt;
    &lt;/ng-template&gt;
  &lt;/app-my-content&gt;
  </code></pre>