title: Form Builder with hasError() for validation throws an error of ERROR TypeError: Cannot read property 'hasError' of undefined
body: <p>Hi I am implementing  a form in angular 2 using Form Builder</p>
  
  <p>in component.ts i have implemented my form using formGroup</p>
  
  <p>Below is My code </p>
  
  <pre><code>public myForm: FormGroup;
  
  constructor(private authenticateservice: AuthenticateService,
                private _fb: FormBuilder
               ) {
  
  
  }
  
  ngOnInit() {
  
  this.myForm = this._fb.group({
        address: [this.userDetails.address, [&lt;any&gt;Validators.required]],
        address2: ['', [&lt;any&gt;Validators.required]],
        city: ['', [&lt;any&gt;Validators.required]],
        company_address: ['', [&lt;any&gt;Validators.required]],
        company_address2: ['', [&lt;any&gt;Validators.required]],
        company_city: ['', [&lt;any&gt;Validators.required]],
        company_country: ['', [&lt;any&gt;Validators.required]],
        company: ['', [&lt;any&gt;Validators.required , Validators.minLength(3)] ],
        company_tax_number: ['', [&lt;any&gt;Validators.required]],
        company_zip: ['', [&lt;any&gt;Validators.required,  Validators.minLength(5) , Validators.maxLength(7)]],
        country: ['', [&lt;any&gt;Validators.required]],
        email: ['', [&lt;any&gt;Validators.required, Validators.email]],
        first_name: [this.userDetails.first_name, [&lt;any&gt;Validators.required]],
        id: ['', [&lt;any&gt;Validators.required]],
        last_name: ['', [&lt;any&gt;Validators.required]],
        phone: ['', [&lt;any&gt;Validators.required, Validators.minLength(10)]],
        zip: ['', [&lt;any&gt;Validators.required , Validators.minLength(5) , Validators.maxLength(7)]],
        user_type: ['2', [&lt;any&gt;Validators.required]],
        terms: [0, [&lt;any&gt;Validators.required]],
        hash_tag: [''],
  
      });
  
  }
  </code></pre>
  
  <p>It is working fine. But when coming to display validations in frontEnd </p>
  
  <p>I used like this </p>
  
  <pre><code>  &lt;div class="form-group row"&gt;
      &lt;div class="col-lg-8"&gt;
        &lt;label&gt;Address 2&lt;/label&gt;
        &lt;textarea class="form-control" placeholder="Address" rows="2" [readonly]="disabled" id="companyaddress2" formControlName="company_address2"&gt;&lt;/textarea&gt;
        &lt;span class="help-block form-error text-danger small" *ngIf="myForm.controls['company_address2'].hasError('required')"&gt;Company Address 2 is Required.&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>it is working but throwing the error in console like Below</p>
  
  <p><strong>ERROR TypeError: Cannot read property 'hasError' of undefined</strong></p>
  
  <p>Please Help me how to sort this.</p>
  
  <p>Thank You.</p>