title: No value accessor for form control with name: 'rating' in Angular 2 mat-dialog with Reactive Froms
body: <p>I have this Review Dialog component :</p>
  
  <pre><code>export class ReviewDialogComponent implements OnInit {
  
    form: FormGroup;
    comments: string;
    rating: number;
  
    constructor(
      private fb: FormBuilder,
      private dialogRef: MatDialogRef&lt;ReviewDialogComponent&gt;,
      @Inject(MAT_DIALOG_DATA) data) {
  
     this.comments = data.comments;
     this.rating = data.rating;
  
     this.form = fb.group({
       comments: [this.comments, []],
       rating: [this.rating, []]
    });
    }
    ngOnInit() {
     }
    save() {
      this.dialogRef.close(this.form.value);
     }
    close() {
     this.dialogRef.close();
    }
  }
  </code></pre>
  
  <p>The html :   </p>
  
  <pre><code>  &lt;mat-dialog-content [formGroup]="form"&gt;
  
     &lt;mat-form-field&gt;
       &lt;textarea matInput
              placeholder="Comments"
              formControlName="comments"&gt;
       &lt;/textarea&gt;
     &lt;/mat-form-field&gt;
  
     &lt;mat-form-field&gt;
       &lt;mat-select placeholder="Select rating"
              formControlName="rating"&gt;
  
        &lt;mat-option value="1"&gt;1&lt;/mat-option&gt;
        &lt;mat-option value="2"&gt;2&lt;/mat-option&gt;
        &lt;mat-option value="3"&gt;3&lt;/mat-option&gt;
        &lt;mat-option value="4"&gt;4&lt;/mat-option&gt;
        &lt;mat-option value="5"&gt;5&lt;/mat-option&gt;
       &lt;/mat-select&gt;
    &lt;/mat-form-field&gt;
  
  &lt;/mat-dialog-content&gt;
  </code></pre>
  
  <p>And usage : </p>
  
  <pre><code>addReview() {
     const dialogConfig = new MatDialogConfig();
  
     dialogConfig.disableClose = true;
     dialogConfig.autoFocus = true;
  
     dialogConfig.data = {
        comments: '',
        rating: null
     };
  
     const dialogRef = this.dialog.open(ReviewDialogComponent,
        dialogConfig);
  
     dialogRef.afterClosed().subscribe(
        val =&gt; console.log("Dialog output:", val)
      );
  }
  </code></pre>
  
  <p>I have all the imports needed, it loads the dialog but it returns the error after a few seconds. I've tried adding <strong>ngDefaultControl</strong> but after that I receive "Error: mat-form-field must contain a MatFormFieldControl." so it doesn't really help. Also, I've already checked <a href="https://stackoverflow.com/questions/38958347/angular2-rc-5-custom-input-no-value-accessor-for-form-control-with-unspecified/39013152#39013152">angular2 rc.5 custom input, No value accessor for form control with unspecified name</a>, didn't help. What am I missing ? </p>
  
  <p>Thanks a lot !</p>