title: @ViewChild - initializer error on Angular 13
body: <p>I am creating app in Angular 13. I want to call the method <code>show()</code> of <code>ChildComponent</code> from <code>ParentComponent</code>, using <code>@ViewChild</code>, but I get errors. The older questions and answers are not working in this case.</p>
  <p><strong>Parent</strong>:</p>
  <pre><code>&lt;app-child #child&gt;&lt;/app-child&gt;
  </code></pre>
  <pre><code>@ViewChild('child') child: ChildComponent;
  
  showChild() {
     this.child.show();
  }
  </code></pre>
  <p><strong>Child</strong>:</p>
  <pre><code>show(){
    console.log('show');
  }
  </code></pre>
  <p><strong>Error:</strong></p>
  <blockquote>
  <p>Property 'child' has no initializer and is not definitely assigned in the constructor.</p>
  </blockquote>
  <hr />
  <h2>Solution 1:</h2>
  <p><strong>Parent</strong>:</p>
  <pre><code>@ViewChild('child') child!: ChildComponent;
  </code></pre>
  <p><strong>Error:</strong></p>
  <blockquote>
  <p>TypeError: Cannot read properties of undefined (reading 'show')</p>
  </blockquote>
  <hr />
  <h2>Solution 2:</h2>
  <p><strong>Parent</strong>:</p>
  <pre><code>@ViewChild('child') child: ChildComponent = new ChildComponent;
  </code></pre>
  <p><strong>Without errors</strong>
  Works fine but I have doubts if this is correct?</p>