title: How to check the validity of the child component form within the parent component in Angular 4
body: <p>I have a scenario where I am accessing two different NgForm one within Parent form #parentform and other in the Child component #childForm, and i want to check the validity of the controls of child form wether valid or not in parent component form. How to do this in angular4.</p>
  
  <p>I also followed this link:
  <a href="https://stackoverflow.com/questions/44943981/check-if-a-form-is-valid-from-a-parent-component-using-angular-4">Check if a form is valid from a parent component using Angular 4</a></p>
  
  <p>everytime i am getting undefined for the reference of child component form.</p>
  
  <p>My code is something like this.</p>
  
  <p>parent.component.html</p>
  
  <pre><code>    &lt;form class="form-wrapper" (ngSubmit)="parentForm.form.valid &amp;&amp; save()" #parentForm="ngForm" novalidate&gt;
          &lt;input id="firstName" type="text" placeholder="" class="validate" name="firstName" [(ngModel)]="firstname_" #firstName="ngModel" required&gt;                        
      &lt;/form&gt;
      &lt;child-component&gt;&lt;/child-component&gt;
  </code></pre>
  
  <p>child.component.html</p>
  
  <pre><code> &lt;form class="form-wrapper" (ngSubmit)="childForm.form.valid &amp;&amp; save()" #childForm="ngForm" novalidate&gt;
          &lt;input id="phoneNumber" type="text" placeholder="" class="validate" name="phoneNumber" [(ngModel)]="phone_" #phoneNumber="ngModel" required&gt;                        
   &lt;/form&gt;
  </code></pre>
  
  <p>Now i want to validate the child component form "childForm" valid or not in parent form</p>