title: Angular 7 - View Child Still Returns as Undefined After Child Component is Initialized
body: <p>I have a component that is utilizing a View Change subscription to watch for changes in a form checkbox.  When the checkbox changes to true, the child component's form is to be set to disabled and enabled when the checkbox is false. Each time I try to call the View Child function when the checkbox is checked, I am returned the following error: 
  ERROR TypeError: Cannot read property 'enableForm' of undefined.</p>
  
  <p>The posts that I've found on here discussing this issue seem to point to the child component being hidden by an ngIf, but this is not the case in my instance.</p>
  
  <p>I've console logged the various Angular life cycle events, NgOnInit, NgAfterViewInit, createForm(), etc and they all return when the form is initialized.  I'm also able to pass a value into the child component that will disable the child form field on Init, so that part is working.  But I cannot get the View Child to work through the same component instance.</p>
  
  <p>Here I initialize my View Child:</p>
  
  <pre><code>@ViewChild('effectiveDateComponent') effectiveDateComponent: any;
  </code></pre>
  
  <p>Here I am listening for form changes in my checkbox (called "futureDelete": </p>
  
  <pre><code>    this.editForm.get('futureDelete').valueChanges.subscribe(val =&gt; {
        if (val === false) {
          this.effectiveDateComponent.disableForm();
          this.deleteButtonDisableFlag = false;
        }
        if (val === true) {
          this.effectiveDateComponent.enableForm();
          this.deleteButtonDisableFlag = true;
          this.editForm.controls.dateSearch.get('date').valueChanges.subscribe(val =&gt; {
            if (val) {
              this.deleteButtonDisableFlag = false;
            }
            if (!val) {
              this.deleteButtonDisableFlag = true;
            }
          });
        }
      });
  </code></pre>
  
  <p>Here is my HTML component call: </p>
  
  <pre><code>&lt;app-datetimepicker #effectiveDateComponent [disabled]="true" [dateField]="'effectiveDate'" (dateEmit)="receiveDateEmit($event)" [placeholder]="'yyyy-mm-dd'"&gt;Effective Date&lt;/app-datetimepicker&gt;
  </code></pre>
  
  <p>I expect either the function disableForm() or enableForm() to be called, but instead I get the following error: ERROR TypeError: Cannot read property 'enableForm' of undefined.</p>