title: Angular datepicker not updating after changing min or max date
body: <p>I have a datepicker inside a mat-card like this:</p>
  <pre><code>&lt;mat-card class=&quot;datepickerContainer&quot;&gt;
      &lt;mat-form-field appearance=&quot;fill&quot;&gt;
          &lt;mat-label&gt;Month and Year&lt;/mat-label&gt;
          &lt;input matInput [min]=&quot;minDate&quot; [max]=&quot;maxDate&quot; [matDatepicker]=&quot;datePicker&quot; [formControl]=&quot;date&quot;&gt;
          &lt;mat-datepicker-toggle matSuffix [for]=&quot;datePicker&quot;&gt;&lt;/mat-datepicker-toggle&gt;
          &lt;mat-datepicker #datePicker
                          startView=&quot;multi-year&quot;
                          (yearSelected)=&quot;yearSelectedHandler($event)&quot;
                          (monthSelected)=&quot;monthSelectedHandler($event, datePicker)&quot;
                          panelClass=&quot;example-month-picker&quot;&gt;
          &lt;/mat-datepicker&gt;
      &lt;/mat-form-field&gt;
  &lt;/mat-card&gt;
  </code></pre>
  <p>Inside <code>ngAfterViewInit()</code>, the min selectable year is set like this based on the year specified in a configuration object:</p>
  <pre><code>  ngAfterViewInit(): void {
      this.configService.getConfiguration().subscribe((configs) =&gt; {
        this.minDate.setFullYear(configs.startYear);
      });
    }
  </code></pre>
  <p>I already debugged this and <code>this.minDate.setFullYear()</code> is being called with the correct year as parameter. However, when I now open the date picker in the frontend, it seems to be completely disabled:</p>
  <p><a href="https://i.stack.imgur.com/GOd1g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GOd1g.png" alt="datepicker disabled" /></a></p>
  <p>I can click on the selected year (2022) but then I cannot select a month:</p>
  <p><a href="https://i.stack.imgur.com/OPabC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OPabC.png" alt="select month disabled" /></a></p>
  <p>I do not disable the date picker anywhere, so why is it disabled and why is the min year not set to 2021? I also noticed that when I initially set the min date to something else (like 2021) already, it is working fine, so the problem must be related to Angular not knowing that I changed the min date in <code>ngAfterViewInit()</code>.</p>