title: Ionic 2 form validation issue with formGroup and ngModel
body: <p>I was trying to implement what seemed to be a straightforward form validation routine following <a href="https://www.joshmorony.com/advanced-forms-validation-in-ionic-2/" rel="nofollow noreferrer">this walk-through</a> on my ionic 2 projects.</p>
  
  <p>In my controller's constructor I used the <code>FormBuilder</code> like this to make a formGroup:</p>
  
  <pre><code>this.form = formBuilder.group({
    date: ['', Validators.required],
    client: ['', Validators.required]
  });
  </code></pre>
  
  <p>And then in the template I added <code>formControllerName</code> attribute to relevant elements like this:</p>
  
  <pre><code>&lt;ion-select formControlName="client" [(ngModel)]="clientId"&gt;
  </code></pre>
  
  <p>And bound the root element to the 'formGroup` like this:</p>
  
  <pre><code>&lt;ion-content [formGroup]="form"&gt;
  </code></pre>
  
  <p>This fails with the following error message:</p>
  
  <blockquote>
    <p>ngModel cannot be used to register form controls with a parent
    formGroup directive.  Try using
          formGroup's partner directive "formControlName" instead.  Example:</p>
  
  <pre><code>&lt;div [formGroup]="myGroup"&gt;
    &lt;input formControlName="firstName"&gt;
  &lt;/div&gt;
  
  In your class:
  
  this.myGroup = new FormGroup({
     firstName: new FormControl()
  });
  
    Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions:
  
    Example:
  
  
  &lt;div [formGroup]="myGroup"&gt;
     &lt;input formControlName="firstName"&gt;
     &lt;input [(ngModel)]="showMoreControls" [ngModelOptions]="{standalone: true}"&gt;
  &lt;/div&gt;
  </code></pre>
  </blockquote>
  
  <p>As suggested by the error message, as well as <a href="https://stackoverflow.com/questions/39126638/ngmodel-cannot-be-used-to-register-form-controls-with-a-parent-formgroup-directi/40588951#40588951">this StackOverflow thread</a> I added <code>[ngModelOptions]="{standalone: true}"</code> to my inputs but it came back with another error message: </p>
  
  <blockquote>
    <p>Template parse errors: Can't bind to 'ngModelOptions' since it isn't a
    known property of 'ion-select'.</p>
  </blockquote>