title: Datepicker two way binding not working in angular 10
body: <p>I'm trying to bind a date from the .ts file but it's not able to bind.</p>
  <p>Here the Woking and not woking code and the question below that</p>
  <pre><code>  //Not working
            &lt;mat-label&gt;Date Of Birth&lt;/mat-label&gt;
                            &lt;input matInput [matDatepicker]=&quot;pickerDOB&quot; [max]=&quot;maxAllowedDateOfBirth&quot; placeholder=&quot;Date of birth&quot; [(ngModel)]=&quot;dateOfBirth&quot;&gt;
                            &lt;mat-datepicker-toggle matSuffix [for]=&quot;pickerDOB&quot;&gt;&lt;/mat-datepicker-toggle&gt;
                            &lt;mat-datepicker #pickerDOB [(ngModel)]=&quot;dateOfBirth&quot;&gt;&lt;/mat-datepicker&gt;
               &lt;/mat-form-field&gt;
          
           //.ts File
                    dateOfBirth: Date = new Date();
              //in on ngOnInit
                      this.dateOfBirth = new Date(
                              this.child.birthYear,
                              this.child.birthMonth,
                              this.child.birthDay
                            );
          
          //working
               &lt;mat-form-field appearance=&quot;fill&quot;&gt;
                                &lt;mat-label&gt;Date Of Birth&lt;/mat-label&gt;
                                &lt;input matInput [matDatepicker]=&quot;pickerDOB&quot; [max]=&quot;maxAllowedDateOfBirth&quot; [formControl]=&quot;dateOfBirth&quot;&gt;
                                &lt;mat-datepicker-toggle matSuffix [for]=&quot;pickerDOB&quot;&gt;&lt;/mat-datepicker-toggle&gt;
                                &lt;mat-datepicker #pickerDOB&gt;&lt;/mat-datepicker&gt;
                              &lt;/mat-form-field&gt;   
   //.ts File      
              dateOfBirth: any;
              
              //in on ngOnInit
               this.dateOfBirth = new FormControl(
                       new Date( 
                        this.child.birthYear,
                        this.child.birthMonth,
                        this.child.birthDay
                      )
                     );
  </code></pre>
  <p>1.Why I need to use a formControl ? is there a way to bind 2 way to a date object.?</p>
  <p>2.if I have to use formControl then how can I get the selected date from formcontrol?
  Note: no selection changed event just wanted to read when I'm saving the form.
  Thanks</p>