title: How to access a child element that is located inside ng-template by its id in a parent component?
body: <p>this is pretty straightforward and I could not find any solution that works for me, including reading the Angular documentation.<br><br>
  So, I want to access a child component from its parent by the child's id because I want to use it in Jasmine unit test for the parent component.<br><br>
  The problem is that the child component is inside ng-template.</p>
  <p>And I don't have a reference to it. I tried different solutions, none of them work.</p>
  <p>This is an example code:<br>
  This ng-template is located in the parent component:</p>
  <pre><code>&lt;ng-template #templateName&gt;
     &lt;child-component id=&quot;child-component&quot;&gt;&lt;/child-component&gt;
  &lt;/ng-template&gt;
  </code></pre>
  <p>And in the <strong>parent component</strong>:</p>
  <pre><code>@ViewChild('templateName') template;
  </code></pre>
  <p>How to access the <code>&lt;child-component&gt; &lt;/child-component&gt;</code> by its id by the parent?
  <br><br>
  Any help would bre greatly appreciated!<br> Thank you!</p>