title: Issue with formGroup.hasError not returning true when custom validator returns error object
body: <p>My angular 2 application uses reactive forms.</p>
  
  <p>I initialize the following <code>FormGroup</code> in one of my components:</p>
  
  <pre><code>  ngOnInit() {
      ...
  
      this.addressForm = this.formBuilder.group({
        address: this.formBuilder.control({
          placeId: this.address.placeId,
          description: this.address.description
        }, addressValidator)
      });
    }
  </code></pre>
  
  <p>Here is the definition for the <code>addressValidator</code>:</p>
  
  <pre><code>import {AbstractControl} from '@angular/forms';
  
  export function addressValidator(control: AbstractControl) {
  
    const {placeId} = control.value;
  
    return (placeId !== undefined &amp;&amp; placeId !== null &amp;&amp; placeId !== '') ? null : {addressValidator: {emptyPlaceId: true}};
  }
  </code></pre>
  
  <p>Here is how I try to check whether the form control i.e. <code>address</code> is in error:</p>
  
  <pre><code>  addressFormErrors(error: string) {
      return this.addressForm.hasError(error, ['address', 'addressValidator']);
    }
  </code></pre>
  
  <p>Here is the template calling the addressFormErrors method:</p>
  
  <pre><code>&lt;form [formGroup]="addressForm" (ngSubmit)="updateAddress()" novalidate&gt;
    &lt;div class="form-group" [ngClass]="getFeedbackClasses(addressForm, 'address', submitted)"&gt;
      &lt;div class="input-group"&gt;
        &lt;input type="text"
           formControlName="address"
           placeholder="{{'ADDRESS_FORM.NEW_ADDRESS' | translate}}"
           [ngbTypeahead]="chooseAddress"
           [inputFormatter]="addressFormatter"
           [resultFormatter]="addressFormatter"
           autocomplete="off"
           class="form-control"
           [ngClass]="formControlStatusClass(addressForm, 'address', submitted)"&gt;
      &lt;/div&gt;
      &lt;div [hidden]="addressForm.valid || !submitted"&gt;
        &lt;div *ngIf="addressFormErrors('emptyPlaceId')" class="form-control-feedback form-control-label"&gt;{{'ADDRESS_FORM.ADDRESS_REQUIRED' | translate}}&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    ...
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is the method invoked upon form submission:</p>
  
  <pre><code>  updateAddress() {
      this.submitted = true;
      if (this.addressForm.valid) {
        const placeId = this.addressForm.controls['address'].value['placeId'];
        this.userAccountService.updateAddress(placeId)
          .subscribe(() =&gt; this.router.navigate(['/dashboard/useraccount']));
      }
    }
  </code></pre>
  
  <p><strong>edit</strong>: Gunter is right: the validator does indeed return the error object on value change. The issue is elsewhere: it is in the <code>addressFormErrors</code> method not returning true - probably due to some mistake in the property path specification. </p>
  
  <p>Can someone please help?</p>